Skip to content

[LINK]: https://arowsr.afrc.af.mil/arows-r/ #33

[LINK]: https://arowsr.afrc.af.mil/arows-r/

[LINK]: https://arowsr.afrc.af.mil/arows-r/ #33

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