Skip to content

Commit

Permalink
Updating pr build workflow to react to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bc3tech committed Jul 19, 2024
1 parent 6887898 commit 27debc0
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions .github/workflows/pr-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,28 @@ on:
paths-ignore:
- "**.md"
- "LICENSE"
issue_comment:
types: [created]

jobs:
isCodeOwner:
if: github.event.issue.pull_request && contains(github.event.comment.body, '/test-pack')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check if comment author is a code owner
id: check
run: |
CODEOWNERS=$(cat .github/CODEOWNERS)
COMMENT_AUTHOR=${{ github.event.comment.user.login }}
if echo "$CODEOWNERS" | grep -q "$COMMENT_AUTHOR"; then
echo "::set-output name=isCodeOwner::true"
else
echo "::set-output name=isCodeOwner::false"
fi
build-release:
runs-on: windows-latest
needs: []
steps:
- uses: actions/checkout@v4

Expand All @@ -21,9 +38,19 @@ jobs:

- name: dotnet build
run: dotnet build -c release

- name: dotnet publish
if: steps.isCodeOwner.outputs.isCodeOwner == 'true'
run: dotnet publish -o pub -c release -p:PublishSingleFile=true -p:Version=${{ env.APP_VERSION }}

- name: Upload binaries
if: steps.isCodeOwner.outputs.isCodeOwner == 'true'
uses: actions/upload-artifact@v4
with:
name: binaries
path: pub/FileSorter.*
build-debug:
runs-on: windows-latest
needs: []
steps:
- uses: actions/checkout@v4

Expand Down

0 comments on commit 27debc0

Please sign in to comment.