From 223ac9a2cfff3676e145d986f7bba26ce8fce64c Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Tue, 3 Jan 2023 17:19:49 -0500 Subject: [PATCH] workflows: update actions to current major versions Fixes deprecation warnings for Node.js 12: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/ --- .github/workflows/post-rollouts.yml | 12 ++++++------ .github/workflows/print-rollouts.yml | 4 ++-- .github/workflows/promote-config.yml | 6 +++--- .github/workflows/rollout.yml | 6 +++--- .github/workflows/stream-diff.yml | 2 +- .github/workflows/validate.yml | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/post-rollouts.yml b/.github/workflows/post-rollouts.yml index e900d11d..3246e2b9 100644 --- a/.github/workflows/post-rollouts.yml +++ b/.github/workflows/post-rollouts.yml @@ -14,15 +14,15 @@ permissions: jobs: post-rollouts: - name: "Post rollouts to PR" + name: Post rollouts to PR runs-on: ubuntu-latest if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }} steps: - name: Download state - uses: actions/github-script@v3 + uses: actions/github-script@v6 with: script: | - var artifacts = await github.actions.listWorkflowRunArtifacts({ + var artifacts = await github.rest.actions.listWorkflowRunArtifacts({ owner: context.repo.owner, repo: context.repo.repo, run_id: ${{github.event.workflow_run.id}}, @@ -30,7 +30,7 @@ jobs: var matchArtifact = artifacts.data.artifacts.filter((artifact) => { return artifact.name == "validation-results" })[0]; - var download = await github.actions.downloadArtifact({ + var download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, repo: context.repo.repo, artifact_id: matchArtifact.id, @@ -45,13 +45,13 @@ jobs: cd validation-results unzip ../validation-results.zip - name: Comment on PR - uses: actions/github-script@v3 + uses: actions/github-script@v6 with: script: | var fs = require('fs'); var pr_number = Number(fs.readFileSync('validation-results/PR')); var rollouts = fs.readFileSync('validation-results/rollouts'); - await github.issues.createComment({ + await github.rest.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo, issue_number: pr_number, diff --git a/.github/workflows/print-rollouts.yml b/.github/workflows/print-rollouts.yml index c7d33045..cc2e4be9 100644 --- a/.github/workflows/print-rollouts.yml +++ b/.github/workflows/print-rollouts.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install dependencies run: | sudo apt-get update @@ -33,7 +33,7 @@ jobs: echo "${{ github.event.number }}" > validation-results/PR mv rollouts validation-results/ - name: Upload state for PR comment - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: validation-results path: validation-results/ diff --git a/.github/workflows/promote-config.yml b/.github/workflows/promote-config.yml index eded4368..69729b06 100644 --- a/.github/workflows/promote-config.yml +++ b/.github/workflows/promote-config.yml @@ -44,14 +44,14 @@ jobs: echo "target_stream=${title%:*}" >> $GITHUB_ENV echo "src_stream=${src_stream}" >> $GITHUB_ENV - name: Checkout fedora-coreos-config - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: coreos/fedora-coreos-config ref: ${{ env.target_stream }} path: fcos token: ${{ secrets.COREOSBOT_RELENG_TOKEN }} - name: Checkout fedora-coreos-releng-automation - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: coreos/fedora-coreos-releng-automation path: fcos-releng-auto @@ -63,7 +63,7 @@ jobs: ../fcos-releng-auto/scripts/promote-config.sh ${src_stream} echo "commit_title=$(git log --pretty=format:%s -1 HEAD)" >> $GITHUB_ENV - name: Open pull request - uses: peter-evans/create-pull-request@v3.8.2 + uses: peter-evans/create-pull-request@v4.2.3 with: token: ${{ secrets.COREOSBOT_RELENG_TOKEN }} path: fcos diff --git a/.github/workflows/rollout.yml b/.github/workflows/rollout.yml index f0abde11..cafc4f64 100644 --- a/.github/workflows/rollout.yml +++ b/.github/workflows/rollout.yml @@ -43,13 +43,13 @@ jobs: - name: Install dependencies run: pip install python-dateutil dateparser - name: Check out repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: # We need an unbroken commit chain when pushing to the fork. Don't # make assumptions about which commits are already available there. fetch-depth: 0 - name: Check out fedora-coreos-stream-generator - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: coreos/fedora-coreos-stream-generator path: generator @@ -120,7 +120,7 @@ jobs: echo "BRANCH_NAME=${branch_name}" >> ${GITHUB_ENV} echo "ROLLOUT_DESC=${rollout_desc}" >> ${GITHUB_ENV} - name: Open pull request - uses: peter-evans/create-pull-request@v3.8.2 + uses: peter-evans/create-pull-request@v4.2.3 with: token: ${{ secrets.COREOSBOT_RELENG_TOKEN }} branch: ${{ env.BRANCH_NAME }} diff --git a/.github/workflows/stream-diff.yml b/.github/workflows/stream-diff.yml index 0f553b5e..941973f1 100644 --- a/.github/workflows/stream-diff.yml +++ b/.github/workflows/stream-diff.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Genericize metadata diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index eb98b155..4103ca1e 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Syntax check run: make syntax-check - name: Check stream generator for dirty working tree