Skip to content

Created publication-request.json from issue #114 [skip workflow] #24

Created publication-request.json from issue #114 [skip workflow]

Created publication-request.json from issue #114 [skip workflow] #24

name: Create Release and Call Workflow on Issue Close
on:
issues:
types: [closed]
jobs:
create_release_and_tag:
if: contains(github.event.issue.labels.*.name, 'Build OK') && contains(github.event.issue.labels.*.name, 'publication-request')
runs-on: ubuntu-latest
steps:
# Checkout repository
- name: Checkout repository
uses: actions/checkout@v2
# Fetch release-candidate branch and read version from publication-request.json
- name: Get version from publication-request.json
run: |
git fetch origin release-candidate
git checkout release-candidate
VERSION=$(jq -r '.version' publication-request.json)
echo "VERSION=$VERSION" >> $GITHUB_ENV
# Create a release and tag with the version
- name: Create release and tag
uses: actions/create-release@v1
with:
tag_name: "v${{ env.VERSION }}"
release_name: "v${{ env.VERSION }}"
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Job to trigger the reusable workflow
trigger_remote_workflow:
needs: create_release_and_tag
runs-on: ubuntu-latest
steps:
# Checkout the branch to determine the current branch name
- name: Checkout repository
uses: actions/checkout@v2
# Get the current branch name
- name: Get current branch
id: get_branch
run: echo "BRANCH=$(git branch --show-current)" >> $GITHUB_ENV
# Trigger the remote reusable workflow and pass the current branch
- name: Trigger remote workflow
uses: WorldHealthOrganization/smart-html/.github/workflows/release.yml@main
with:
branch: ${{ env.BRANCH }} # Pass the current branch to the remote workflow