Skip to content

gha test

gha test #8

Workflow file for this run

name: Release Module
on:
pull_request:
branches: [master,main]
types: [closed]
jobs:
update_release_draft:
permissions:
contents: write
pull-requests: write
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
echo "$GITHUB_CONTEXT"
- name: Check PR labels
id: check_pr_label
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
API_URL="https://api.github.com/repos/${GITHUB_REPOSITORY}/pulls/${{ github.event.pull_request.number }}"
PR_LABELS=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "$API_URL" | jq --raw-output '.labels | map(.name) | join(", ")')
echo "PR_LABELS=$PR_LABELS" >> $GITHUB_ENV
NUMBER_OF_LABELS=$(echo "$PR_LABELS" |wc -w)
echo "Found: $PR_LABELS"
if [ "$NUMBER_OF_LABELS" -eq "1" ] ; then
echo "Found: $LABELS"
echo "release-type=$LABELS" >> "$GITHUB_OUTPUT"
fi