ci: move variables to `env` (#104605)

* ci: move variables to `env`

* ci: move sha to `env`

* ci: import `SHA` and `PRE_COMMIT_SHA`
pull/104617/head
Sven Grossmann 2 months ago committed by GitHub
parent e2ac229bc5
commit d19f86a736
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 23
      .github/workflows/pr-patch-check-event.yml

@ -17,6 +17,13 @@ on:
# target branch onto the source branch, to verify compatibility before merging.
jobs:
dispatch-job:
env:
HEAD_REF: ${{ github.head_ref }}
BASE_REF: ${{ github.base_ref }}
REPO: ${{ github.repository }}
SENDER: ${{ github.event.sender.login }}
SHA: ${{ github.sha }}
PR_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
runs-on: ubuntu-latest
steps:
- name: "Generate token"
@ -31,18 +38,20 @@ jobs:
with:
github-token: ${{ steps.generate_token.outputs.token }}
script: |
const {HEAD_REF, BASE_REF, REPO, SENDER, SHA, PR_COMMIT_SHA} = process.env;
await github.rest.actions.createWorkflowDispatch({
owner: 'grafana',
repo: 'security-patch-actions',
workflow_id: 'test-patches-event.yml',
ref: 'main',
inputs: {
src_repo: "${{ github.repository }}",
src_ref: "${{ github.head_ref }}",
src_merge_sha: "${{ github.sha }}",
src_pr_commit_sha: "${{ github.event.pull_request.head.sha }}",
patch_repo: "${{ github.repository }}-security-patches",
patch_ref: "${{ github.base_ref }}",
triggering_github_handle: "${{ github.event.sender.login }}"
src_repo: REPO,
src_ref: HEAD_REF,
src_merge_sha: SHA,
src_pr_commit_sha: PR_COMMIT_SHA,
patch_repo: REPO + '-security-patches',
patch_ref: BASE_REF,
triggering_github_handle: SENDER
}
})

Loading…
Cancel
Save