Skip to content

Initial Release

Initial Release #8

Workflow file for this run

name: Pre-Release
on:
push:
branches:
- '*'
- '!main'
jobs:
pre_release:
name: Pre-Release
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
node-version: [ '20' ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: |
npm install
- name: Set Branch Name
id: set_branch_name
run: |
BRANCH_NAME=${GITHUB_REF#refs/heads/}
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
echo $BRANCH_NAME
- name: Check for existing release
id: check_release
run: |
TAG_NAME="v${{ steps.set_branch_name.outputs.branch_name }}"
RELEASE_ID=$(curl -s -H "Authorization: token ${{ secrets.PAT_TOKEN }}" "https://api.github.com/repos/action-pylint/releases/tags/${TAG_NAME}" | jq -r '.id // empty')
echo "::set-output name=release_id::${RELEASE_ID}"
- name: Delete existing release
if: steps.check_release.outputs.release_id != ''
run: |
curl -X DELETE -s -H "Authorization: token ${{ secrets.PAT_TOKEN }}" "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ steps.check_release.outputs.release_id }}"
- name: Create Pre-Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.set_branch_name.outputs.branch_name }}
release_name: v${{ steps.set_branch_name.outputs.branch_name }}
prerelease: true