Skip to content

Commit

Permalink
Add issue labeler
Browse files Browse the repository at this point in the history
Signed-off-by: Marcos Candeia <marrcooos@gmail.com>
  • Loading branch information
mcandeia committed Aug 30, 2024
1 parent c342658 commit 913bf9f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 29 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/issues.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Label issues
on:
issues:
types:
- reopened
- opened
jobs:
label_issues:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- run: gh issue edit "$NUMBER" --add-label "$LABELS"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
LABELS: triage
11 changes: 7 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ on: # yamllint disable-line rule:truthy
push:
tags:
- "**"

workflow_dispatch: # Allows manual dispatch with parameters
inputs:
tag_name:
description: "The tag to be published"
required: true
permissions: write-all
jobs:
release:
Expand All @@ -15,10 +19,9 @@ jobs:
runs-on: "ubuntu-latest"

steps:
- name: "Determine tag"
run: 'echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV'

- name: "Create release"
env:
RELEASE_TAG: ${{ github.event.inputs.tag_name || github.ref_name }}
uses: "actions/github-script@v6"
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
Expand Down
33 changes: 8 additions & 25 deletions .github/workflows/releaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,28 +149,11 @@ jobs:
run: |
git tag ${{ steps.determine_version.outputs.new_version }}
git push origin ${{ steps.determine_version.outputs.new_version }}
- name: "Create release"
if: steps.determine_version.outputs.new_version != ''
uses: "actions/github-script@v6"
env:
RELEASE_TAG: ${{ steps.determine_version.outputs.new_version }}
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
script: |
const tag = process.env.RELEASE_TAG;
try {
const response = await github.rest.repos.createRelease({
draft: false,
generate_release_notes: true,
name: `Release ${tag}`,
owner: context.repo.owner,
prerelease: tag.includes("rc-") || tag.includes("preview") || tag.includes("beta") || tag.includes("alpha"),
repo: context.repo.repo,
tag_name: tag,
});
core.exportVariable('RELEASE_ID', response.data.id);
core.exportVariable('RELEASE_UPLOAD_URL', response.data.upload_url);
} catch (error) {
core.setFailed(error.message);
}
- name: Trigger Release Workflow
run: |
curl -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.everest-preview+json" \
https://api.github.com/repos/${{ github.repository }}/actions/workflows/release.yaml/dispatches \
-d '{"ref":"main", "inputs":{"tag_name":"${{ steps.determine_version.outputs.new_version }}"}}'

0 comments on commit 913bf9f

Please sign in to comment.