From 43a63fa05fce92a2293ae8feebe5583608ba6fe5 Mon Sep 17 00:00:00 2001 From: Nick Rimmer Date: Fri, 15 Nov 2024 00:12:25 +0100 Subject: [PATCH] set states --- .github/workflows/pr-scheduler.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr-scheduler.yml b/.github/workflows/pr-scheduler.yml index 1368011..9745f89 100644 --- a/.github/workflows/pr-scheduler.yml +++ b/.github/workflows/pr-scheduler.yml @@ -82,6 +82,8 @@ jobs: - name: Set pending Status uses: actions/github-script@v6 + env: + prSha: ${{ matrix.pr.head.sha }} with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | @@ -93,8 +95,6 @@ jobs: context: 'PR Validation / Auto', description: 'Validation is in progress...', }); - env: - prSha: ${{ matrix.pr.head.sha }} - name: Prepare Validation uses: actions/checkout@v4 @@ -126,14 +126,14 @@ jobs: if: success() uses: actions/github-script@v6 env: - pr: ${{ matrix.pr }} + prSha: ${{ matrix.pr.head.sha }} with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | await github.rest.repos.createCommitStatus({ owner: context.repo.owner, repo: context.repo.repo, - sha: process.env.pr.head.sha, + sha: process.env.prSha, state: 'success', context: 'PR Validation / Auto', description: 'Validation passed successfully.', @@ -143,14 +143,14 @@ jobs: if: failure() uses: actions/github-script@v6 env: - pr: ${{ matrix.pr }} + prSha: ${{ matrix.pr.head.sha }} with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | await github.rest.repos.createCommitStatus({ owner: context.repo.owner, repo: context.repo.repo, - sha: process.env.pr.head.sha, + sha: process.env.prSha, state: 'failure', context: 'PR Validation / Auto', description: 'Validation failed.',