-
Notifications
You must be signed in to change notification settings - Fork 1
37 lines (35 loc) · 1.13 KB
/
append_from_issue.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
name: Append Link from Approved Link Request
on:
issues:
types: [closed]
jobs:
get_fields:
runs-on: ubuntu-latest
if: contains(github.event.issue.labels.*.name, 'link request')
steps:
- name: get_fields
run: |
TITLE=$(echo "$BODY" | sed -n 3p)
URL=$(echo "$BODY" | sed -n 7p)
[[ -z $TITLE ]] && exit 1
[[ -z $URL ]] && exit 1
TITLE="TITLE=$TITLE"
URL="URL=$URL"
echo $TITLE | tee -a $GITHUB_ENV
echo $URL | tee -a $GITHUB_ENV
env:
BODY: ${{ github.event.issue.body }}
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install jq & sponge
run: |
sudo apt-get update
sudo apt-get install --yes jq moreutils
- name: Add link to end of list
run: |
jq -r --arg TITLE "${{ env.TITLE }}" --arg URL "${{ env.URL }}" '.OTHER += [{"title": $TITLE,"link": $URL}]' src/links/links_other.json | sponge src/links/links_other.json
cat src/links/links_other.json
- name: Commit New Changes
uses: EndBug/add-and-commit@v7
with:
message: Updated links from Issue