Skip to content

Commit

Permalink
Update release-sync.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaski committed Feb 1, 2024
1 parent a58d864 commit 0b1dc14
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/release-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,19 @@ jobs:
fetch-depth: 0

- name: Determine sync status and fetch commits
id: set_commits
id: init
run: |
LATEST_RELEASE_TAG=$(git describe --tags $(git rev-list --tags --max-count=1) 2>/dev/null | head -1)
LATEST_RELEASE_COMMIT=$(git rev-list -n 1 ${LATEST_RELEASE_TAG} 2>/dev/null | head -1)
COMMITS_SINCE_LAST_RELEASE=$(git log ${LATEST_RELEASE_COMMIT}..HEAD --oneline)
HAVE_RELEASE=$(test "${LATEST_RELEASE_COMMIT}" = "${GITHUB_SHA}" && echo "true" || echo "false")
echo "Latest release tag: ${LATEST_RELEASE_TAG}"
echo "Latest release commit: ${LATEST_RELEASE_COMMIT}"
echo "GITHUB_SHA: ${GITHUB_SHA}"
echo "HAVE_RELEASE: ${HAVE_RELEASE}"
echo "COMMITS_SINCE_LAST_RELEASE:"
echo ""
echo "${COMMITS_SINCE_LAST_RELEASE}"
if [[ "${LATEST_RELEASE_COMMIT}" != "${GITHUB_SHA}" ]]; then
echo "HAVE_RELEASE=false" >> $GITHUB_ENV
else
echo "HAVE_RELEASE=true" >> $GITHUB_ENV
fi
echo "have_release="${HAVE_RELEASE}"" >> $GITHUB_OUTPUT
echo "commits="${COMMITS_SINCE_LAST_RELEASE}"" >> $GITHUB_OUTPUT
- name: Manage issues based on sync status
Expand All @@ -44,8 +41,8 @@ jobs:
HAVE_RELEASE: ${{ env.HAVE_RELEASE }}
with:
script: |
const have_release = process.env.HAVE_RELEASE === 'true';
const commitsSinceLastRelease = `${{ steps.set_commits.outputs.commits }}`;
const have_release = '${{ steps.init.outputs.have_release }}' === 'true';
const commitsSinceLastRelease = `${{ steps.init.outputs.commits }}`;
const { data: issues } = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down

0 comments on commit 0b1dc14

Please sign in to comment.