Skip to content

Commit

Permalink
ci: better filtering of node tag
Browse files Browse the repository at this point in the history
  • Loading branch information
tchataigner committed Jun 12, 2024
1 parent 8760ae1 commit 4123628
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions .github/workflows/aptos-repo-port.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@ jobs:
- name: Fetch latest tag
id: latest-tag
run: |
LATEST_TAG=$(curl --silent "https://api.github.com/repos/aptos-labs/aptos-core/tags" | jq -r '.[].name' | grep '^aptos-node-v' | sort -V | tail -n 1)
echo "name=tag::${LATEST_TAG}" | tee -a $GITHUB_OUTPUT
LATEST_TAG=$(curl --silent "https://api.github.com/repos/aptos-labs/aptos-core/releases" | jq -r '.[] | select(.name | ascii_downcase | contains("mainnet")) | .tag_name' | grep '^aptos-node-v' | sort -V | tail -n 1)
CURRENT_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
if [[ $(echo -e "$CURRENT_TAG\n$LATEST_TAG" | sort -V | tail -n 1) != $CURRENT_TAG ]]; then
echo "name=tag::${LATEST_TAG}" | tee -a $GITHUB_OUTPUT
else
echo "The current tag is up to date."
exit 0
fi
- name: Compare and rebase
id: rebase
Expand All @@ -43,15 +49,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: ${{ matrix.branch }}
TAG: ${{ steps.latest-tag.outputs.tag }}
with:
script: |
const issue = {
owner: context.repo.owner,
repo: context.repo.repo,
title: `Rebase conflicts detected on branch ${{ matrix.branch }}`,
body: `Rebase conflicts detected when trying to rebase branch ${{ matrix.branch }} onto tag ${{ steps.latest-tag.outputs.tag }}. Please resolve them manually.`
}
github.rest.issues.create(issue)

- name: Create Pull Request
if: ${{ success() }}
Expand Down

0 comments on commit 4123628

Please sign in to comment.