Skip to content

Fix summary YAML formatting #2

Fix summary YAML formatting

Fix summary YAML formatting #2

name: Create release on branch changes
on:
push:
branches-ignore:
# Dependabot does not have permissions to create releases
- 'dependabot/**'
jobs:
create_release_on_branch_changes:
name: "Create release on branch changes"
runs-on: ubuntu-latest
steps:

Check failure on line 13 in .github/workflows/create-release-on-branch-changes.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/create-release-on-branch-changes.yml

Invalid workflow file

You have an error in your yaml syntax on line 13
- name: Set release variables
id: resolve-release-vars
run: |
RELEASE_BRANCH=${{ github.event.pull_request.head.ref }}
RELEASE_SHA=${{ github.event.pull_request.head.sha }}
TAG_NAME=$(echo "branch-${RELEASE_BRANCH}")
echo "RELEASE_BRANCH=$RELEASE_BRANCH" >> "$GITHUB_ENV"
echo "RELEASE_SHA=$RELEASE_SHA" >> "$GITHUB_ENV"
echo "TAG_NAME=$TAG_NAME" >> "$GITHUB_ENV"
# Version 0.0.0-SHA is a schema that supports semantic versioning but
# should sink below proper versions.
# Output package.json to provide insight and help debugging
# Using branch names as tags allows other projects to track unreleased
# development.
echo "NPM_VERSION=0.0.0-${RELEASE_SHA}" >> "$GITHUB_ENV"
echo "DIST_FILENAME=dist-$RELEASE_BRANCH.zip" >> "$GITHUB_ENV"
# Checkout the HEAD of the PR branch to get the latest commit message.
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Get release description
run: |
echo "RELEASE_DESCRIPTION=$(git show -s --format=%s)" >> "$GITHUB_ENV"
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
registry-url: "https://npm.pkg.github.com"
scope: "@${{ github.repository_owner }}"
- run: yarn install --frozen-lockfile
- name: Building
run: yarn css:build
- name: Bundling assets
run: ./bundle.sh
env:
VERSION: ${{ env.TAG_NAME }}-${{ env.RELEASE_SHA }}
- name: Rename assets
run: |
mv dist.zip $DIST_FILENAME
- name: Delete existing releases
uses: dev-drprasad/[email protected]
with:
tag_name: ${{ env.TAG_NAME }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create or update tag
uses: EndBug/[email protected]
with:
ref: ${{ env.TAG_NAME }}
- name: Create release
id: create-release
uses: softprops/action-gh-release@v1
with:
prerelease: true
target_commitish: ${{ env.RELEASE_SHA }}
tag_name: ${{ env.TAG_NAME }}
body: ${{ env.RELEASE_DESCRIPTION }}
files: ${{ env.DIST_FILENAME }}
- name: Adding summary
run: |
echo "Release created 🚀😎 at: ${{ steps.create-release.outputs.url }}" >> $GITHUB_STEP_SUMMARY
- name: Release NPM package
run: |
npm version ${{ env.NPM_VERSION }} --no-git-tag-version
echo ${{ env.TAG_NAME }}
cat package.json
npm publish --tag ${{ env.TAG_NAME }}
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Adding summary
run: |
echo "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 28 28\" fill=\"none\" data-package-type=\"NPM\" class=\"mr-2\">
<path d=\"M25.9434 0H2.05656C0.920751 0 0 0.920751 0 2.05656V25.9434C0 27.0792 0.920751 28 2.05656 28H25.9434C27.0792 28 28 27.0792 28 25.9434V2.05656C28 0.920751 27.0792 0 25.9434 0Z\" fill=\"#CB0000\"></path>
<path d=\"M5.96399 22.3652H14.0463L14.0565 10.2624H18.0874L18.0771 22.3755H22.1182L22.1285 6.2315L5.98455 6.21094L5.96399 22.3652Z\" fill=\"white\"></path>
</svg> Npm package created 🚀. Version: ${{ env.NPM_VERSION }}" >> $GITHUB_STEP_SUMMARY