diff --git a/.github/workflows/changelog.yaml b/.github/workflows/changelog.yaml index cee20e2..eee5af5 100644 --- a/.github/workflows/changelog.yaml +++ b/.github/workflows/changelog.yaml @@ -21,10 +21,10 @@ jobs: if [[ ${{ github.ref_name }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then gh release create ${{ github.ref_name }} --generate-notes || true fi - if: github.event_name == 'push' && github.ref_type == 'tag' env: GH_TOKEN: ${{ secrets.TOKEN }} + if: github.event_name == 'push' && github.ref_type == 'tag' - name: Get Date id: get-date run: echo "date=$(/bin/date -u "+%Y%m%d%H%M%S")" >> $GITHUB_OUTPUT diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 3ed6007..f5d8cd2 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -54,7 +54,7 @@ jobs: if: env.HAS_SECRETS == 'HAS_SECRETS' - name: Publish run: c2cciutils-publish - if: env.HAS_SECRETS == 'HAS_SECRETS' env: SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} GITHUB_TOKEN: ${{ secrets.TOKEN }} + if: env.HAS_SECRETS == 'HAS_SECRETS' diff --git a/.github/workflows/pull-request-automation.yaml b/.github/workflows/pull-request-automation.yaml index 7168697..4bf38a4 100644 --- a/.github/workflows/pull-request-automation.yaml +++ b/.github/workflows/pull-request-automation.yaml @@ -13,7 +13,16 @@ jobs: timeout-minutes: 5 steps: - - uses: actions/github-script@v7 + - name: Print context + uses: actions/github-script@v7 + with: + script: |- + console.log(context); + env: + GITHUB_TOKEN: ${{ secrets.TOKEN }} + if: github.event.pull_request.user.login == 'renovate[bot]' + - name: Auto reviews Renovate updates + uses: actions/github-script@v7 with: script: |- github.rest.pulls.createReview({ @@ -22,13 +31,9 @@ jobs: pull_number: context.payload.pull_request.number, event: 'APPROVE', }) - env: - GITHUB_TOKEN: ${{ secrets.TOKEN }} - name: Auto reviews Renovate updates if: github.event.pull_request.user.login == 'renovate[bot]' - name: Auto review and merge snyk auto fix uses: actions/github-script@v7 - if: github.event.pull_request.user.login == 'sbrunner' && startsWith(github.head_ref, 'snyk-fix/') with: script: |- github.rest.pulls.createReview({ @@ -51,9 +56,9 @@ jobs: } } `) + if: github.event.pull_request.user.login == 'sbrunner' && startsWith(github.head_ref, 'snyk-fix/') - name: Auto close pre-commit.ci autoupdate uses: actions/github-script@v7 - if: github.event.pull_request.user.login == 'pre-commit-ci' with: script: |- github.rest.pulls.update({ @@ -62,3 +67,4 @@ jobs: pull_number: context.payload.pull_request.number, state: 'closed', }); + if: github.event.pull_request.user.login == 'pre-commit-ci'