Skip to content

Commit

Permalink
Update publication-accepted.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
costateixeira authored Oct 17, 2024
1 parent 44b5ecc commit 8af35da
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions .github/workflows/publication-accepted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,22 @@ on:

jobs:
create_release_and_tag:
# if: contains(github.event.issue.labels.*.name, 'Build OK') && contains(github.event.issue.labels.*.name, 'publication-request')
if: contains(join(github.event.issue.labels.*.name, ','), 'Build OK') && contains(join(github.event.issue.labels.*.name, ','), 'publication-request')
runs-on: ubuntu-latest
steps:
# Checkout repository
- name: Checkout repository
# Checkout repository and switch to the release-candidate branch
- name: Checkout release-candidate branch
uses: actions/checkout@v2
with:
ref: release-candidate
fetch-depth: 0 # Fetch all history for all branches and tags

# Fetch release-candidate branch and read version from publication-request.json
# Fetch the 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
# Capture the current branch and set it as an output
- name: Get current branch
id: get_branch
run: echo "::set-output name=BRANCH::$(git rev-parse --abbrev-ref HEAD)"


# Create a release and tag with the version
- name: Create release and tag
uses: actions/create-release@v1
Expand All @@ -38,8 +33,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Trigger the remote reusable workflow and pass the current branch
# Trigger the remote reusable workflow and pass the release-candidate branch
- name: Trigger remote workflow
uses: WorldHealthOrganization/smart-html/.github/workflows/release.yml@main
with:
branch: ${{ steps.get_branch.outputs.BRANCH }} # Pass the current branch to the remote workflow
branch: release-candidate # Always use the release-candidate branch

0 comments on commit 8af35da

Please sign in to comment.