π₯ Mapserv is down #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Issue opened (new incident) | |
on: | |
issues: | |
types: [opened] | |
jobs: | |
open-pr: | |
name: Create new incident post | |
runs-on: ubuntu-latest | |
steps: | |
- name: π¬ Update status | |
id: update_status | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const response = await github.rest.reactions.createForIssue({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.payload.issue.number, | |
content: 'eyes' | |
}); | |
return response.data.id; | |
- name: π¬ Check actor | |
uses: tspascoal/get-user-teams-membership@v3 | |
id: checkUserMember | |
with: | |
username: ${{ github.actor }} | |
team: committers | |
GITHUB_TOKEN: ${{ secrets.ORG_READ_PAT }} | |
- name: π Stop if not member | |
if: ${{ steps.checkUserMember.outputs.isTeamMember == false }} | |
run: | | |
echo "You cannot run this job." | |
exit 86 | |
- name: β¬οΈ Checkout Repository | |
uses: actions/checkout@v4 | |
- name: β Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
cache: npm | |
- name: π¦ Install script dependencies | |
working-directory: scripts | |
run: npm install | |
- name: π Create new incident | |
working-directory: scripts | |
run: node new-incident.js ${{ github.event.issue.number }} | |
- name: π Create pull request | |
id: cpr | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: 'feat: create new incident post' | |
title: 'feat: create new incident post' | |
body: | | |
This PR was automatically created by the "Issue opened (new incident)" workflow. | |
closes #${{ github.event.issue.number}} | |
branch: feat/new-incident-${{ github.event.issue.number }} | |
draft: true | |
- name: ποΈ Remove reaction | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
github.rest.reactions.deleteForIssue({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.payload.issue.number, | |
reaction_id: ${{ steps.update_status.outputs.result }} | |
}) | |
- name: β Set complete reaction | |
uses: actions/github-script@v7 | |
if: ${{ steps.cpr.outputs.pull-request-number }} | |
with: | |
script: | | |
github.rest.reactions.createForIssue({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.payload.issue.number, | |
content: 'rocket' | |
}); |