diff --git a/.github/workflows/template-main.yml b/.github/workflows/template-main.yml index 0d016b3..858e182 100644 --- a/.github/workflows/template-main.yml +++ b/.github/workflows/template-main.yml @@ -27,12 +27,16 @@ jobs: OTP_VERSION: ${{ vars.OTP_VERSION }} SKIP_GIT_HOOKS: 'true' SKIP_RELEASE: ${{ contains(github.event.head_commit.message, '[skip release]') || contains(github.event.head_commit.message, '[skip ci]') || contains(github.event.head_commit.message, '[release skip]') || contains(github.event.head_commit.message, '[ci skip]') }} - GITHUB_BRANCH: ${GITHUB_REF#refs/*/} - GITHUB_REPO_URL: "${{ github.server_url }}/${{ github.repository }}.git" steps: - uses: actions/checkout@v4 + - name: Set Env Variables + if: ${{ env.SKIP_RELEASE == 'false' }} + run: | + echo "GITHUB_BRANCH=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + echo "GITHUB_REPO_URL=${{ github.server_url }}/${{ github.repository }}.git" >> $GITHUB_ENV + - name: Create A File if: ${{ env.SKIP_RELEASE == 'false' }} run: echo '{"repositoryUrl":"${{ env.GITHUB_REPO_URL }}","branches":["${{ env.GITHUB_BRANCH }}"],"plugins":[["@semantic-release/commit-analyzer",{"preset":"eslint","releaseRules":[{"tag":"breaking","release":"major"},{"tag":"feat","release":"minor"},{"tag":"chore","release":"minor"},{"tag":"refactor","release":"minor"},{"tag":"update","release":"minor"},{"tag":"upgrade","release":"minor"},{"tag":"docs","release":"patch"},{"tag":"ci","release":"patch"},{"tag":"fix","release":"patch"},{"tag":"test","release":"patch"},{"tag":"perf","release":"patch"},{"scope":"no-release","release":false}]}],["@semantic-release/release-notes-generator",{"preset":"conventionalcommits","presetConfig":{"types":[{"type":"breaking","section":"Major version release","hidden":false},{"type":"BREAKING","section":"Major version release","hidden":false},{"type":"BREAKING CHANGE","section":"Major version release","hidden":false},{"type":"BREAKING CHANGES","section":"Major version release","hidden":false},{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"update","section":"Updates","hidden":false},{"type":"upgrade","section":"Upgrades","hidden":false},{"type":"docs","section":"Documentation","hidden":false},{"type":"chore","section":"Chores","hidden":false},{"type":"ci","section":"CI/CD Changes","hidden":false},{"type":"test","section":"Tests","hidden":false},{"type":"refactor","section":"Refactoring","hidden":false},{"type":"perf","section":"Performance Improvements","hidden":false}]},"writerOpts":{"commitsSort":["subject","scope"]}}],"@semantic-release/github",["@semantic-release/changelog",{"changelogFile":"docs/CHANGELOG.md"}]]}' > .releaserc2