-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: keep path to event json file in composite actions #1428
Conversation
The event.json paths need to be copied over, since it the GithubContext is recreated from the composite RC. And that does read some value for the event file if available.
🦙 MegaLinter status: ✅ SUCCESS
See errors details in artifact MegaLinter reports on CI Job page |
Codecov Report
@@ Coverage Diff @@
## master #1428 +/- ##
==========================================
+ Coverage 57.50% 63.74% +6.23%
==========================================
Files 32 41 +9
Lines 4594 6476 +1882
==========================================
+ Hits 2642 4128 +1486
- Misses 1729 2049 +320
- Partials 223 299 +76
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Add this test? You can append the steps to the test for github.head_ref github.base_ref on: push
jobs:
_:
runs-on: self-hosted
container: ubuntu:latest
steps:
- run: |
runs:
using: composite
steps:
- run: |
echo WORKFLOW_GITHUB_CONTEXT="$WORKFLOW_GITHUB_CONTEXT"
echo COMPOSITE_GITHUB_CONTEXT="$COMPOSITE_GITHUB_CONTEXT"
[[ "$WORKFLOW_GITHUB_CONTEXT" = "$COMPOSITE_GITHUB_CONTEXT" ]]
env:
WORKFLOW_GITHUB_CONTEXT: ${{ tojson(tojson(github.event)) }}
COMPOSITE_GITHUB_CONTEXT: ${{ '${{tojson(github.event)}}' }}
shell: bash
shell: cp {0} action.yml
- uses: ./ I verified that this change fixes the issue and this test will only pass with a user provided event.json file with this patch.
Both should be equal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer that this includes a test, like the one in my comment. However this should be fixed asap.
You are right that we need a test for this. It's quite important. |
@KnisterPeter this pull request has failed checks 🛠 |
The test from above doesn't seem to work as expected. |
Copy pasting a test is not trivial, I will fix your yaml errors |
Thanks 😂 |
The event.json paths need to be copied over, since it the
GithubContext is recreated from the composite RC. And that
does read some value from the event file if available.
Fixes #1401