Skip to content

Bump rubocop from 1.68.0 to 1.69.0 #315

Bump rubocop from 1.68.0 to 1.69.0

Bump rubocop from 1.68.0 to 1.69.0 #315

Workflow file for this run

name: Release PR Merged
on:
pull_request:
types:
- closed
jobs:
release:
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/') == true
name: Release PR Merged
runs-on: ubuntu-latest
permissions:
contents: write
deployments: write
issues: write
packages: write
timeout-minutes: 60
steps:
- name: Setup Docker BuildX
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Retrieve Release Version
uses: actions/github-script@v7
id: release-version
with:
result-encoding: string
script: |
const pull = ${{ toJSON(github.event.pull_request) }};
const branchName = pull.head.ref;
const version = branchName.match(/release\/(?<version>v[\d]+\.[\d]+\.[\d]+)/).groups.version;
const major_version = version.split('.')[0]
console.debug({version})
core.setOutput('full', version)
core.setOutput('major', major_version)
- name: Start Deployment
uses: bobheadxi/deployments@v1
id: deployment
with:
step: start
env: release
- name: Retag and Push Images
uses: akhilerm/[email protected]
with:
src: ghcr.io/heromo/pronto-action:latest
dst: |
ghcr.io/heromo/pronto-action:${{ steps.release-version.outputs.major }}
ghcr.io/heromo/pronto-action:${{ steps.release-version.outputs.full }}
- name: Publish Release
uses: actions/github-script@v7
with:
script: |
const { data: release } = await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: '${{ steps.release-version.outputs.full }}',
name: '${{ steps.release-version.outputs.full }}',
generate_release_notes: true,
});
core.setOutput('release', release);
console.debug({release})
# TODO: add to update major version tag
# - name: Update Major Version GIT tag
# uses: actions/github-script@v7
# with:
# github-token: ${{ secrets.RELEASE_WORKFLOW }}
# script: |
# const refParams = {
# owner: context.repo.owner,
# repo: context.repo.repo,
# ref: 'tags/${{ steps.release-version.outputs.full }}',
# }
# const { data: { object: { sha } } } = await github.rest.git.getRef(refParams);
# console.debug({sha});
# const result = await github.rest.git.updateRef({
# ...refParams,
# sha,
# ref: 'tags/${{ steps.release-version.outputs.major }}',
# force: true,
# });
# console.debug(result);
- name: Update Deployment
uses: bobheadxi/deployments@v1
if: always()
with:
step: finish
status: ${{ job.status }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
env: ${{ steps.deployment.outputs.env }}
env_url: https://github.com/HeRoMo/pronto-action/releases/tag/${{ env.RELEASE_VERSION }}
- name: Create Issue on Failure
if: failure()
uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const create = await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: "Failed to deploy release to production",
body: "Automation has failed! Failed to publish release ${{ env.RELEASE_VERSION }}\nMore information can be found at:\n - ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
assignees: ['${{ github.repository_owner }}']
})