-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #909 from ergebnis/feature/reuse
Enhancement: Reuse composite actions from `ergebnis/.github`
- Loading branch information
Showing
2 changed files
with
2 additions
and
50 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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]" | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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); | ||
} |