-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (50 loc) · 1.81 KB
/
add-weekly-gh-requests.yml
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Create weekly issues
on:
schedule:
- cron: 0 0 * * 0
workflow_dispatch: {}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
create_issue:
name: Create weekly issues
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- run: |
gh issue create --repo "openedx/axim-engineering" \
--title "Welcome new discourse members" \
--label "github-request" \
--body "Go through [new discourse introductions](https://discuss.openedx.org/c/community/introductions/18) and welcome new people to the community."
tag_and_notify:
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.GRAPHQL_AUTH_APP_ID }}
private_key: ${{ secrets.GRAPHQL_AUTH_APP_PEM }}
- name: Tag axim on-call
env:
URL: ${{ github.event.issue.comments_url }}
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
curl \
-X POST \
$URL \
-H "Content-Type: application/json" \
-H "Authorization: token $GITHUB_TOKEN" \
--data '{ "body": "@openedx/axim-oncall - heads up on this request." }'
- name: Send custom JSON data to Slack workflow
id: slack
uses: slackapi/[email protected]
with:
# This data can be any valid JSON from a previous step in the GitHub Action
payload: |
{
"msg": "${{ github.event.issue.title }}\nAuthor: ${{ github.event.issue.user.login }}\nURL: https://www.github.com/openedx/axim-engineering/issues/${{ github.event.issue.number }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}