1877b671cb
* use push event instead of pull_request_target * pull request sha -> push sha * remove PR specific stuff from pr-patch-check * use my branch for testing * use main now that it's working
61 lines
1.9 KiB
YAML
61 lines
1.9 KiB
YAML
name: Dispatch check for patch conflicts
|
|
on:
|
|
push:
|
|
branches-ignore:
|
|
- "main"
|
|
- "release-*.*.*"
|
|
tags-ignore:
|
|
- "*"
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
dispatch-job:
|
|
permissions:
|
|
id-token: write
|
|
contents: read
|
|
actions: write
|
|
env:
|
|
REPO: ${{ github.repository }}
|
|
SENDER: ${{ github.event.sender.login }}
|
|
SHA: ${{ github.sha }}
|
|
runs-on: ubuntu-latest
|
|
if: github.repository == 'grafana/grafana'
|
|
steps:
|
|
- name: "Get vault secrets"
|
|
id: vault-secrets
|
|
uses: grafana/shared-workflows/actions/get-vault-secrets@main
|
|
with:
|
|
# Secrets placed in the ci/data/repo/grafana/grafana/delivery-bot-app path in Vault
|
|
repo_secrets: |
|
|
GRAFANA_DELIVERY_BOT_APP_PEM=delivery-bot-app:PRIVATE_KEY
|
|
- name: "Generate token"
|
|
id: generate_token
|
|
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a
|
|
with:
|
|
# App needs Actions: Read/Write for the grafana/security-patch-actions repo
|
|
app_id: ${{ vars.DELIVERY_BOT_APP_ID }}
|
|
private_key: ${{ env.GRAFANA_DELIVERY_BOT_APP_PEM }}
|
|
- name: "Dispatch job"
|
|
uses: actions/github-script@v7
|
|
with:
|
|
github-token: ${{ steps.generate_token.outputs.token }}
|
|
script: |
|
|
const {REPO, SENDER, 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: REPO,
|
|
src_ref: 'main',
|
|
src_merge_sha: SHA,
|
|
src_pr_commit_sha: SHA,
|
|
patch_repo: REPO + '-security-patches',
|
|
patch_ref: 'main',
|
|
triggering_github_handle: SENDER
|
|
}
|
|
})
|