Skip to content

Commit

Permalink
Merge pull request #10 from Avivbens/semantic-report-support
Browse files Browse the repository at this point in the history
chore: semantic report for each pr
  • Loading branch information
Avivbens authored Jan 18, 2024
2 parents 6e24d94 + 1867224 commit 2de60af
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/pr-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
branches:
- master

permissions: write-all

jobs:
PR-checks:
# https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/using-self-hosted-runners-in-a-workflow
Expand All @@ -18,3 +20,31 @@ jobs:

- name: 🧪 Check out repository code
uses: ./.github/workflows/health-check

- name: 🔬 Check semantic versioning
id: semantic-release
run: |
GITHUB_REF=${{ github.head_ref }}
npx semantic-release --no-ci --dry-run --plugins @semantic-release/commit-analyzer,@semantic-release/release-notes-generator --branches ${{ github.head_ref }} > output.txt
OUTPUT=$(cat output.txt | base64 -w 0)
echo "::set-output name=releaseNote::$OUTPUT"
- name: 📝 Report semantic versioning
uses: actions/github-script@v3
if: ${{ steps.semantic-release.outputs.releaseNote != '' }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
let fromBuffer = Buffer.from('${{ steps.semantic-release.outputs.releaseNote }}', 'base64').toString('utf8');
let releaseNote = fromBuffer.split('\n').filter((line) => !line.match(/^[[0-9:\sAMPM]+\]\s\[semantic-release\].*$/));
let res = releaseNote.join('\n');
if (!releaseNote.length || !res) {
return;
}
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `The new semantic report is: \n ${res}`,
})
1 change: 1 addition & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$schema": "https://json.schemastore.org/semantic-release.json",
"repositoryUrl": "https://github.com/Avivbens/rx-parallel.git",
"branches": [
"+([0-9])?(.{+([0-9]),x}).x",
"master",
Expand Down

0 comments on commit 2de60af

Please sign in to comment.