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",
|
"type": "check-changelog",
|
||||||
"title": "Changelog Check",
|
"title": "Changelog Check",
|
||||||
|
35
.github/workflows/auto-milestone.yml
vendored
35
.github/workflows/auto-milestone.yml
vendored
@ -1,39 +1,26 @@
|
|||||||
name: Auto-milestone
|
name: Auto-milestone
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request_target:
|
||||||
types:
|
types:
|
||||||
- opened
|
- opened
|
||||||
- reopened
|
- reopened
|
||||||
- closed
|
- 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:
|
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:
|
main:
|
||||||
needs: config
|
|
||||||
if: needs.config.outputs.has-secrets
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: github.event.pull_request.draft == false
|
||||||
steps:
|
steps:
|
||||||
- name: "Generate token"
|
# Note: Github will not trigger other actions from this because it uses
|
||||||
id: generate_token
|
# the GITHUB_TOKEN token
|
||||||
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
|
|
||||||
with:
|
|
||||||
app_id: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
|
|
||||||
private_key: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
|
|
||||||
|
|
||||||
- name: Run auto-milestone
|
- name: Run auto-milestone
|
||||||
uses: grafana/grafana-github-actions-go/auto-milestone@main
|
uses: grafana/grafana-github-actions-go/auto-milestone@main
|
||||||
with:
|
with:
|
||||||
pr: ${{ github.event.pull_request.number }}
|
pr: ${{ github.event.pull_request.number }}
|
||||||
token: ${{ steps.generate_token.outputs.token }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
Loading…
Reference in New Issue
Block a user