Skip to content

Commit

Permalink
refactor(actions): Remove variables from action versions
Browse files Browse the repository at this point in the history
Github doesn't support interpolating versions in `uses` blocks, so reverted back to just specifying SHAs directly. Bummer.
  • Loading branch information
Andrew Anguiano committed Jun 26, 2024
1 parent f3f5f56 commit c99a855
Show file tree
Hide file tree
Showing 16 changed files with 45 additions and 49 deletions.
3 changes: 1 addition & 2 deletions .github/actions/add-commit-status/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ runs:
using: composite
steps:
- name: Add commit status
uses: actions/github-script@${{ vars.ACTIONS_GITHUB_SCRIPT_SHA }}
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410
env:
STATE: ${{ inputs.state }}
STATUS_CONTEXT: ${{ inputs.statusContext }}
Expand All @@ -37,4 +37,3 @@ runs:
const result = await github.rest.repos.createCommitStatus(args);
console.log("Result:", result)
5 changes: 2 additions & 3 deletions .github/actions/bootstrap/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ runs:
using: composite
steps:
- name: Setup node
uses: actions/setup-node@${{ vars.ACTIONS_SETUP_NODE_SHA }}
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7
with:
node-version: 16

Expand All @@ -14,7 +14,7 @@ runs:
working-directory: utils
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
- uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
Expand All @@ -25,4 +25,3 @@ runs:
- name: Install dependencies
shell: bash
run: cd utils && yarn install --frozen-lockfile

6 changes: 3 additions & 3 deletions .github/workflows/pr-merged.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@${{ vars.ACTIONS_CHECKOUT_SHA }}
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
with:
token: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
ref: "release"
Expand All @@ -39,7 +39,7 @@ jobs:
- name: Temporarily disable branch protections
id: disable-branch-protection
if: always()
uses: actions/github-script@${{ vars.ACTIONS_GITHUB_SCRIPT_SHA }}
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410
with:
github-token: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
script: |
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
- name: Re-enable branch protections
id: enable-branch-protection
if: always()
uses: actions/github-script@${{ vars.ACTIONS_GITHUB_SCRIPT_SHA }}
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410
with:
github-token: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
script: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-project-board.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@${{ vars.ACTIONS_CHECKOUT_SHA }}
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744

- name: Move PR to Project Board for triage
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@${{ vars.ACTIONS_CHECKOUT_SHA }}
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744

- name: Setup workspace
uses: "./.github/actions/bootstrap"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@${{ vars.ACTIONS_CHECKOUT_SHA }}
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
with:
token: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
ref: "main"
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Temporarily disable branch protections
id: disable-branch-protection
if: always()
uses: actions/github-script@${{ vars.ACTIONS_GITHUB_SCRIPT_SHA }}
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410
with:
github-token: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
script: |
Expand All @@ -65,7 +65,7 @@ jobs:
- name: Re-enable branch protections
id: enable-branch-protection
if: always()
uses: actions/github-script@${{ vars.ACTIONS_GITHUB_SCRIPT_SHA }}
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410
with:
github-token: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
script: |
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
# Checkout fetch-depth: 2 because there's a check to see if package.json
# was updated, and need at least 2 commits for the check to function properly
- name: Checkout repo
uses: actions/checkout@${{ vars.ACTIONS_CHECKOUT_SHA }}
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
with:
fetch-depth: 2

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/repolinter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ jobs:
steps:
- name: Test Default Branch
id: default-branch
uses: actions/github-script@${{ vars.ACTIONS_GITHUB_SCRIPT_SHA }}
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410
with:
script: |
const data = await github.rest.repos.get(context.repo)
return data.data && data.data.default_branch === context.ref.split('/').slice(-1)[0]
- name: Checkout Self
if: ${{ steps.default-branch.outputs.result == 'true' }}
uses: actions/checkout@${{ vars.ACTIONS_CHECKOUT_SHA }}
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- name: Run Repolinter
if: ${{ steps.default-branch.outputs.result == 'true' }}
uses: newrelic/repolinter-action@${{ vars.ACTIONS_REPO_LINTER_ACTION_SHA }}
uses: newrelic/repolinter-action@3f4448f855c351e9695b24524a4111c7847b84cb
with:
config_url: https://raw.githubusercontent.com/newrelic/.github/main/repolinter-rulesets/community-project.yml
output_type: issue
10 changes: 5 additions & 5 deletions .github/workflows/reusable.quickstart_submission.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@${{ vars.ACTIONS_CHECKOUT_SHA }}
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
# Ensure we have the most recent commit to `main`
with:
ref: "main"
Expand All @@ -55,7 +55,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@${{ vars.ACTIONS_CHECKOUT_SHA }}
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
# Ensure we have the most recent commit to `main`
with:
ref: "main"
Expand All @@ -80,7 +80,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@${{ vars.ACTIONS_CHECKOUT_SHA }}
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
# Ensure we have the most recent commit to `main`
with:
ref: "main"
Expand All @@ -105,7 +105,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@${{ vars.ACTIONS_CHECKOUT_SHA }}
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
# Ensure we have the most recent commit to `main`
with:
ref: "main"
Expand All @@ -130,7 +130,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@${{ vars.ACTIONS_CHECKOUT_SHA }}
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
# Ensure we have the most recent commit to `main`
with:
ref: "main"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@${{ vars.ACTIONS_CHECKOUT_SHA }}
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744

- name: Setup workspace
uses: "./.github/actions/bootstrap"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale-message.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@${{ vars.ACTIONS_STALE_SHA }}
- uses: actions/stale@6f05e4244c9a0b2ed3401882b05d701dd0a7289b
with:
stale-issue-message: "Old issues will be closed after 105 days of inactivity. This issue has been quiet for 90 days and is being marked as stale. Reply here to keep this issue open."
close-issue-message: "This issue is being closed due to inactivity. Is this a mistake? Please re-open this issue or create a new one."
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/submit-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ jobs:
run: echo "${{ github.event.pull_request.number }}" > pr_number_submit.txt

- name: upload artifact
uses: actions/upload-artifact@${{ vars.ACTIONS_UPLOAD_ARTIFACT_SHA }}
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
path: pr_number_submit.txt
5 changes: 2 additions & 3 deletions .github/workflows/validate_data_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: dawidd6/action-download-artifact@${{ vars.DAWIDD6_ACTION_DOWNLOAD_ARTIFACT_SHA }}
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
with:
workflow: validation_gate.yml
run_id: ${{ github.event.workflow_run.id }}
Expand All @@ -24,7 +24,7 @@ jobs:
echo "pr-number=$PR_NUMBER" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@${{ vars.ACTIONS_CHECKOUT_SHA }}
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
with:
ref: "refs/pull/${{ env.pr-number }}/merge"

Expand Down Expand Up @@ -54,4 +54,3 @@ jobs:
with:
statusContext: "Validation / Data source schema compliance"
state: ${{ job.status }}

5 changes: 2 additions & 3 deletions .github/workflows/validate_install_plans.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: dawidd6/action-download-artifact@${{ vars.DAWIDD6_ACTION_DOWNLOAD_ARTIFACT_SHA }}
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
with:
workflow: validation_gate.yml
run_id: ${{ github.event.workflow_run.id }}
Expand All @@ -24,7 +24,7 @@ jobs:
echo "pr-number=$PR_NUMBER" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@${{ vars.ACTIONS_CHECKOUT_SHA }}
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
with:
ref: "refs/pull/${{ env.pr-number }}/merge"

Expand Down Expand Up @@ -53,4 +53,3 @@ jobs:
with:
statusContext: "Validation / Install plan schema compliance"
state: ${{ job.status }}

32 changes: 16 additions & 16 deletions .github/workflows/validate_packs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: dawidd6/action-download-artifact@${{ vars.DAWIDD6_ACTION_DOWNLOAD_ARTIFACT_SHA }}
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
with:
workflow: validation_gate.yml
run_id: ${{ github.event.workflow_run.id }}
Expand All @@ -27,7 +27,7 @@ jobs:
echo "pr-number=$PR_NUMBER" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@${{ vars.ACTIONS_CHECKOUT_SHA }}
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
with:
ref: "refs/pull/${{ env.pr-number }}/merge"

Expand All @@ -50,7 +50,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: dawidd6/action-download-artifact@${{ vars.DAWIDD6_ACTION_DOWNLOAD_ARTIFACT_SHA }}
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
with:
workflow: validation_gate.yml
run_id: ${{ github.event.workflow_run.id }}
Expand All @@ -62,7 +62,7 @@ jobs:
echo "pr-number=$PR_NUMBER" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@${{ vars.ACTIONS_CHECKOUT_SHA }}
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
with:
ref: "refs/pull/${{ env.pr-number }}/merge"

Expand All @@ -85,7 +85,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: dawidd6/action-download-artifact@${{ vars.DAWIDD6_ACTION_DOWNLOAD_ARTIFACT_SHA }}
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
with:
workflow: validation_gate.yml
run_id: ${{ github.event.workflow_run.id }}
Expand All @@ -97,7 +97,7 @@ jobs:
echo "pr-number=$PR_NUMBER" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@${{ vars.ACTIONS_CHECKOUT_SHA }}
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
with:
ref: "refs/pull/${{ env.pr-number }}/merge"

Expand All @@ -120,7 +120,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: dawidd6/action-download-artifact@${{ vars.DAWIDD6_ACTION_DOWNLOAD_ARTIFACT_SHA }}
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
with:
workflow: validation_gate.yml
run_id: ${{ github.event.workflow_run.id }}
Expand All @@ -132,7 +132,7 @@ jobs:
echo "pr-number=$PR_NUMBER" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@${{ vars.ACTIONS_CHECKOUT_SHA }}
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
with:
ref: "refs/pull/${{ env.pr-number }}/merge"

Expand Down Expand Up @@ -168,7 +168,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: dawidd6/action-download-artifact@${{ vars.DAWIDD6_ACTION_DOWNLOAD_ARTIFACT_SHA }}
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
with:
workflow: validation_gate.yml
run_id: ${{ github.event.workflow_run.id }}
Expand All @@ -180,7 +180,7 @@ jobs:
echo "pr-number=$PR_NUMBER" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@${{ vars.ACTIONS_CHECKOUT_SHA }}
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
with:
ref: "refs/pull/${{ env.pr-number }}/merge"

Expand Down Expand Up @@ -208,7 +208,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: dawidd6/action-download-artifact@${{ vars.DAWIDD6_ACTION_DOWNLOAD_ARTIFACT_SHA }}
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
with:
workflow: validation_gate.yml
run_id: ${{ github.event.workflow_run.id }}
Expand All @@ -220,7 +220,7 @@ jobs:
echo "pr-number=$PR_NUMBER" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@${{ vars.ACTIONS_CHECKOUT_SHA }}
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
with:
ref: "refs/pull/${{ env.pr-number }}/merge"

Expand Down Expand Up @@ -250,7 +250,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: dawidd6/action-download-artifact@${{ vars.DAWIDD6_ACTION_DOWNLOAD_ARTIFACT_SHA }}
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
with:
workflow: validation_gate.yml
run_id: ${{ github.event.workflow_run.id }}
Expand All @@ -262,7 +262,7 @@ jobs:
echo "pr-number=$PR_NUMBER" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@${{ vars.ACTIONS_CHECKOUT_SHA }}
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
with:
ref: "refs/pull/${{ env.pr-number }}/merge"

Expand All @@ -284,7 +284,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: dawidd6/action-download-artifact@${{ vars.DAWIDD6_ACTION_DOWNLOAD_ARTIFACT_SHA }}
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
with:
workflow: validation_gate.yml
run_id: ${{ github.event.workflow_run.id }}
Expand All @@ -296,7 +296,7 @@ jobs:
echo "pr-number=$PR_NUMBER" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@${{ vars.ACTIONS_CHECKOUT_SHA }}
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
with:
ref: "refs/pull/${{ env.pr-number }}/merge"

Expand Down
Loading

0 comments on commit c99a855

Please sign in to comment.