Skip to content

Commit

Permalink
Merge pull request #909 from ergebnis/feature/reuse
Browse files Browse the repository at this point in the history
Enhancement: Reuse composite actions from `ergebnis/.github`
  • Loading branch information
localheinz authored Mar 20, 2022
2 parents 9c6a6e6 + 01df3c5 commit f79b28f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 50 deletions.
16 changes: 1 addition & 15 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,23 +88,9 @@ jobs:
run: "echo \"RELEASE_TAG=${GITHUB_REF#refs/tags/}\" >> $GITHUB_ENV"

- name: "Create release"
uses: "actions/github[email protected].0"
uses: "ergebnis/.github/actions/github/release/[email protected].0"
with:
github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"
script: |
try {
await github.rest.repos.createRelease({
draft: false,
generate_release_notes: true,
name: process.env.RELEASE_TAG,
owner: context.repo.owner,
prerelease: false,
repo: context.repo.repo,
tag_name: process.env.RELEASE_TAG,
});
} catch (error) {
core.setFailed(error.message);
}

- name: "Upload release assets"
uses: "actions/[email protected]"
Expand Down
36 changes: 1 addition & 35 deletions .github/workflows/triage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,6 @@ jobs:

steps:
- name: "Add labels based on branch name"
uses: "actions/github[email protected].0"
uses: "ergebnis/.github/actions/github/pull-request/[email protected].0"
with:
github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"
script: |
const branchPrefixLabels = {
feature: "enhancement",
fix: "bug",
};
const pullRequest = context.payload.pull_request;
const branchName = pullRequest.head.ref;
const matches = branchName.match(new RegExp('^([^/]+)\/'));
if (!matches instanceof Array) {
return;
}
if (!branchPrefixLabels.hasOwnProperty(matches[1])) {
return;
}
const label = branchPrefixLabels[matches[1]];
try {
await github.rest.issues.addLabels({
issue_number: pullRequest.number,
labels: [
label,
],
owner: context.repo.owner,
repo: context.repo.repo,
});
} catch (error) {
core.setFailed(error.message);
}

0 comments on commit f79b28f

Please sign in to comment.