Skip to content

Commit

Permalink
fix local testing with act
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Sep 27, 2023
1 parent 0fc9353 commit a1d18dd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 22 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ jobs:
- python:3.10-slim

steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
echo "$GITHUB_CONTEXT"
- name: Checkout
uses: actions/checkout@v3

Expand Down Expand Up @@ -74,7 +80,7 @@ jobs:
echo "::set-output name=ansible-core-version::$TAG_NAME"
- name: Build and Push
if: github.event_name == 'release'
if: github.event_name == 'release' && !github.event.act
uses: docker/build-push-action@v4
with:
context: .
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/event-log.yml.bak

This file was deleted.

5 changes: 3 additions & 2 deletions .github/workflows/release-event.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"act": true,
"action": "created",
"ref": "refs/tags/v0.0.0-test2",
"ref": "refs/tags/v2.12.0",
"sha": "b7e12928f13caf61af40d3e8788649a1a8f24c22",
"release": {
"tag_name": "v0.0.0-test2"
"tag_name": "v2.12.0"
}
}
2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function build {

# testing release-triggered workflow
function test-act-release {
gh act -W '.github/workflows/build-release.yml' -e .github/workflows/release-event.json -s GITHUB_TOKEN="$(gh auth token)" --matrix py-base-image:pypy:3.10-slim
gh act release -W '.github/workflows/build-release.yml' -e .github/workflows/release-event.json -s GITHUB_TOKEN="$(gh auth token)" --matrix py-base-image:pypy:3.10-slim
}

# -----------------------------------------------------------------------------
Expand Down

0 comments on commit a1d18dd

Please sign in to comment.