2020-10-07 02:33:05 -05:00
|
|
|
name: Run commands when issues are labeled or comments added
|
|
|
|
on:
|
|
|
|
issues:
|
2023-02-10 08:52:24 -06:00
|
|
|
types: [labeled, unlabeled]
|
2020-10-07 02:33:05 -05:00
|
|
|
issue_comment:
|
|
|
|
types: [created]
|
2022-02-10 07:01:18 -06:00
|
|
|
concurrency:
|
|
|
|
group: issue-commands-${{ github.event.issue.number }}
|
2020-10-07 02:33:05 -05:00
|
|
|
jobs:
|
2023-08-02 06:25:23 -05:00
|
|
|
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_MISC_STATS_API_KEY != '' && secrets.ISSUE_COMMANDS_TOKEN != '') || '' }}" ]; then
|
|
|
|
echo "has-secrets=1" >> "$GITHUB_OUTPUT"
|
|
|
|
fi
|
|
|
|
|
2020-10-07 02:33:05 -05:00
|
|
|
main:
|
2023-08-02 06:25:23 -05:00
|
|
|
needs: config
|
|
|
|
if: needs.config.outputs.has-secrets
|
2020-10-07 02:33:05 -05:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout Actions
|
2023-09-05 03:10:10 -05:00
|
|
|
uses: actions/checkout@v4
|
2020-10-07 02:33:05 -05:00
|
|
|
with:
|
|
|
|
repository: "grafana/grafana-github-actions"
|
|
|
|
path: ./actions
|
|
|
|
ref: main
|
|
|
|
- name: Install Actions
|
|
|
|
run: npm install --production --prefix ./actions
|
|
|
|
- name: Run Commands
|
|
|
|
uses: ./actions/commands
|
|
|
|
with:
|
2020-10-08 09:06:24 -05:00
|
|
|
metricsWriteAPIKey: ${{secrets.GRAFANA_MISC_STATS_API_KEY}}
|
2023-02-07 09:08:40 -06:00
|
|
|
token: ${{secrets.ISSUE_COMMANDS_TOKEN}}
|
2020-10-26 13:43:58 -05:00
|
|
|
configPath: commands
|