-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (30 loc) · 1.14 KB
/
issue-closed.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: 'When issue closed'
on:
issues:
types: [closed]
permissions:
contents: read
issues: write
jobs:
link-azure:
runs-on: ubuntu-latest
if: contains(github.event.issue.labels.*.name, 'setup-app')
steps:
- name: Check out the code
uses: actions/checkout@v4
- name: "Check if secrets are set"
run: |
if [ -z "$APPLICATION_PRIVATE_KEY" ] || [ -z "$APPLICATION_ID"] ; then
gh issue reopen ${{ github.event.issue.number }}
gh issue comment ${{ github.event.issue.number }} -m "To continue, we need to have both secrets names `APPLICATION_PRIVATE_KEY` or `APPLICATION_ID` to be set.\n\nPlease set them and try again."
exit 1
fi
env:
APPLICATION_PRIVATE_KEY: ${{ secrets.APPLICATION_PRIVATE_KEY }}
APPLICATION_ID: ${{ secrets.APPLICATION_ID }}
- name: Run the script
run: |
cat .github/workflows/link-azure.tpl | sed "s|@@REPO@@|${{ github.server_url }}/${{ github.repository }}|g" | \
gh issue create -t "Link Azure to GitHub" -F - -l link-azure
env:
GH_TOKEN: ${{ github.token }}