diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index ec22040..f2d8dba 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -41,12 +41,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - - - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: pnpm + - run: corepack enable && corepack prepare pnpm@latest --activate - run: pnpm install --frozen-lockfile @@ -62,12 +57,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - - - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: pnpm + - run: corepack enable && corepack prepare pnpm@latest --activate - run: pnpm install --frozen-lockfile diff --git a/.gitea/workflows/deploy-preview.yaml b/.gitea/workflows/deploy-preview.yaml index c8cd69c..9562c34 100644 --- a/.gitea/workflows/deploy-preview.yaml +++ b/.gitea/workflows/deploy-preview.yaml @@ -10,12 +10,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - - - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: pnpm + - run: corepack enable && corepack prepare pnpm@latest --activate - run: pnpm install --frozen-lockfile @@ -48,17 +43,11 @@ jobs: done - name: Comment preview URL - uses: actions/github-script@v7 - with: - script: | - const { owner, repo } = context.repo; - const issue_number = context.issue.number; - const body = `## Preview Deploy\nNamespace: \`preview-${issue_number}\`\nArgoCD will sync automatically from branch \`${context.payload.pull_request.head.ref}\`.`; - await fetch(`${process.env.GITHUB_API_URL}/repos/${owner}/${repo}/issues/${issue_number}/comments`, { - method: 'POST', - headers: { - 'Authorization': `token ${process.env.GITHUB_TOKEN}`, - 'Content-Type': 'application/json' - }, - body: JSON.stringify({ body }) - }); + env: + GITEA_TOKEN: ${{ gitea.token }} + run: | + curl -s -X POST \ + -H "Authorization: token ${GITEA_TOKEN}" \ + -H "Content-Type: application/json" \ + -d "{\"body\": \"## Preview Deploy\nNamespace: \`preview-${{ gitea.event.number }}\`\nArgoCD will sync automatically.\"}" \ + "${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/issues/${{ gitea.event.number }}/comments" diff --git a/.gitea/workflows/deploy-production.yaml b/.gitea/workflows/deploy-production.yaml index 2fd6064..8a9d3b0 100644 --- a/.gitea/workflows/deploy-production.yaml +++ b/.gitea/workflows/deploy-production.yaml @@ -10,12 +10,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - - - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: pnpm + - run: corepack enable && corepack prepare pnpm@latest --activate - run: pnpm install --frozen-lockfile