fix(tangle-dapp): Fix liquid staking pools bugs #752
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Validate PR Title | |
on: | |
pull_request: | |
types: [opened, edited, synchronize] | |
jobs: | |
validate-pr-title: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Enable corepack | |
run: | | |
corepack enable | |
corepack prepare [email protected] --activate | |
yarn set version 4.2.2 | |
- name: Set up Node.js environment | |
uses: actions/[email protected] | |
with: | |
node-version: '>=18.12.x' | |
- name: Install dependencies | |
run: yarn install | |
- name: Extract PR title | |
id: extract_pr_title | |
run: echo "title=$(jq -r '.pull_request.title' $GITHUB_EVENT_PATH)" >> $GITHUB_OUTPUT | |
- name: Fetch commit messages | |
id: fetch_commits | |
run: | | |
commits=$(jq -r '.pull_request.commits_url' $GITHUB_EVENT_PATH) | |
curl -s $commits | jq -r '.[].commit.message' > commit_messages.txt | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Check for release commit | |
id: check_commit | |
# Check if any commit message starts with [RELEASE] | |
run: | | |
if grep -qE '^\[RELEASE\]' commit_messages.txt; then | |
echo "contains_release=true" >> $GITHUB_ENV | |
else | |
echo "contains_release=false" >> $GITHUB_ENV | |
fi | |
- name: Validate PR title | |
id: check_pr_title | |
run: | | |
if [[ "${{ env.contains_release }}" == "true" && ! "${{ steps.extract_pr_title.outputs.title }}" =~ ^\[RELEASE\] ]]; then | |
echo "PR title must start with [RELEASE] if any commit starts with [RELEASE]." | |
exit 1 | |
else | |
echo "${{ steps.extract_pr_title.outputs.title }}" | yarn commitlint --verbose | |
fi |