Release Osquery Version to Webstite #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Osquery Version to Webstite | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: Osquery Release Version | |
required: true | |
type: string | |
permissions: | |
pull-requests: write | |
contents: write | |
actions: write | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: source | |
fetch-depth: 0 | |
- name: generate json files | |
run: ruby tools/new_release.rb "${{ github.event.inputs.version }}" . | |
- name: Git Commit | |
run: | | |
git checkout -B release-"${{ github.event.inputs.version }}" | |
git add --all | |
git -c user.name='github-actions[bot]' -c user.email='github-actions[bot]@users.noreply.github.com' commit -m "Release ${{ github.event.inputs.version }}" | |
- name: git push | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: git push --set-upstream origin release-"${{ github.event.inputs.version }}" --force | |
# This is a gnarly command for updating an existing, or making a new PR | |
# https://github.com/cli/cli/discussions/5792 | |
- name: Generate PR | |
run: gh pr edit 'release-${{ github.event.inputs.version }}' -b '${{ env.PR_BODY }}' -t '${{ env.PR_TITLE }}' && gh pr reopen '${{ env.BRANCH_NAME }}' || gh pr create --base source --fill --head 'release-${{ github.event.inputs.version }}' | |
env: | |
GH_TOKEN: ${{ github.token }} | |