Skip to content

chore(deps): bump SonarSource/sonarcloud-github-action from 2.1.1 to 2.3.0 #43

chore(deps): bump SonarSource/sonarcloud-github-action from 2.1.1 to 2.3.0

chore(deps): bump SonarSource/sonarcloud-github-action from 2.1.1 to 2.3.0 #43

name: Publish New GitHub Release
on:
pull_request:
types:
- closed
branches:
- main
jobs:
release:
name: Publish New GitHub Release
runs-on: ubuntu-latest
if: (startsWith(github.event.pull_request.head.ref, 'release/') || startsWith(github.event.pull_request.head.ref, 'hotfix-release/')) && github.event.pull_request.merged == true # only merged pull requests must trigger this job
steps:
- name: Extract Version
id: extract-version
run: |
branch_name="${{ github.event.pull_request.head.ref }}"
version=${branch_name#hotfix-}
version=${version#release/v}
echo "release_version=$version" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v4.1.0
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4.0.1
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install Dependencies
env:
HUSKY: 0
run: |
npm ci
# In order to make a commit, we need to initialize a user.
# You may choose to write something less generic here if you want, it doesn't matter functionality wise.
- name: Initialize Mandatory Git Config
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "noreply@github.com"
- name: Tag & Create GitHub Release
id: create_release
env:
HUSKY: 0
GITHUB_TOKEN: ${{ secrets.PAT }}
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{ secrets.PAT }}
run: |
git fetch --tags origin
git tag -a v${{ steps.extract-version.outputs.release_version }} -m "chore: release v${{ steps.extract-version.outputs.release_version }}"
git push origin refs/tags/v${{ steps.extract-version.outputs.release_version }}
npm run release:github
echo "DATE=$(date)" >> $GITHUB_ENV
- name: Pull Changes Into develop Branch
uses: repo-sync/pull-request@v2.12.1
with:
source_branch: 'main'
destination_branch: 'develop'
github_token: ${{ secrets.GITHUB_TOKEN }}
pr_title: 'chore(release): pull main into develop post release v${{ steps.extract-version.outputs.release_version }}'
pr_body: ':crown: *An automated PR*'
- name: Delete Release Branch
uses: koj-co/delete-merged-action@master
if: startsWith(github.event.pull_request.head.ref, 'release/')
with:
branches: 'release/*'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Delete Hotfix Release Branch
uses: koj-co/delete-merged-action@master
if: startsWith(github.event.pull_request.head.ref, 'hotfix-release/')
with:
branches: 'hotfix-release/*'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Notify Slack Channel
id: slack
uses: slackapi/slack-github-action@v1.24.0
continue-on-error: true
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
PROJECT_NAME: 'Rudder Shopify Tracker'
RELEASES_URL: 'https://github.com/rudderlabs/rudder-shopify-tracker/releases/tag/'
with:
channel-id: ${{ secrets.SLACK_RELEASE_CHANNEL_ID }}
payload: |
{
"text": "*<${{env.RELEASES_URL}}v${{ steps.extract-version.outputs.release_version }}|v${{ steps.extract-version.outputs.release_version }}>*\nCC: <@U03KG4BK1L1> <@U01LVJ30QEB> <@U01FG952S8Y>",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": ":tada: ${{ env.PROJECT_NAME }} - New GitHub Release :tada:"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*<${{env.RELEASES_URL}}v${{ steps.extract-version.outputs.release_version }}|v${{ steps.extract-version.outputs.release_version }}>*\nCC: <@U03KG4BK1L1> <@U01LVJ30QEB> <@U01FG952S8Y>"
}
}
]
}