mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
CI: Run auto-milestone on pull_request_target for forks (#89410)
* CI: Run auto-milestone on pull_request_target for forks * remove milestone check
This commit is contained in:
parent
2bc75016da
commit
51afe257a3
7
.github/pr-checks.json
vendored
7
.github/pr-checks.json
vendored
@ -1,11 +1,4 @@
|
||||
[
|
||||
{
|
||||
"type": "check-milestone",
|
||||
"title": "Milestone Check",
|
||||
"targetUrl": "https://github.com/grafana/grafana/blob/main/contribute/merge-pull-request.md#assign-a-milestone",
|
||||
"success": "Milestone set",
|
||||
"failure": "Milestone not set"
|
||||
},
|
||||
{
|
||||
"type": "check-changelog",
|
||||
"title": "Changelog Check",
|
||||
|
35
.github/workflows/auto-milestone.yml
vendored
35
.github/workflows/auto-milestone.yml
vendored
@ -1,39 +1,26 @@
|
||||
name: Auto-milestone
|
||||
on:
|
||||
pull_request:
|
||||
pull_request_target:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
- closed
|
||||
- ready_for_review
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
|
||||
# Note: this action runs with write permissions on GITHUB_TOKEN even from forks
|
||||
# so it must not run untrusted code (such as checking out the pull request)
|
||||
jobs:
|
||||
config:
|
||||
runs-on: "ubuntu-latest"
|
||||
outputs:
|
||||
has-secrets: ${{ steps.check.outputs.has-secrets }}
|
||||
steps:
|
||||
- name: "Check for secrets"
|
||||
id: check
|
||||
shell: bash
|
||||
run: |
|
||||
if [ -n "${{ (secrets.GRAFANA_DELIVERY_BOT_APP_ID != '' && secrets.GRAFANA_DELIVERY_BOT_APP_PEM != '') || '' }}" ]; then
|
||||
echo "has-secrets=1" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
main:
|
||||
needs: config
|
||||
if: needs.config.outputs.has-secrets
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.pull_request.draft == false
|
||||
steps:
|
||||
- name: "Generate token"
|
||||
id: generate_token
|
||||
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
|
||||
with:
|
||||
app_id: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
|
||||
private_key: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
|
||||
|
||||
# Note: Github will not trigger other actions from this because it uses
|
||||
# the GITHUB_TOKEN token
|
||||
- name: Run auto-milestone
|
||||
uses: grafana/grafana-github-actions-go/auto-milestone@main
|
||||
with:
|
||||
pr: ${{ github.event.pull_request.number }}
|
||||
token: ${{ steps.generate_token.outputs.token }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
Loading…
Reference in New Issue
Block a user