-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
[Bug]: Action variables in PR body #507
Comments
Hi @kdeldycke nice find. One remark: Further remark |
* fix: 🐛 Signed-off-by: Andy Augustin <dev@andreas-augustin.org> * fix: 🐛 Signed-off-by: Andy Augustin <dev@andreas-augustin.org> * fix: 🐛 Signed-off-by: Andy Augustin <dev@andreas-augustin.org> * fix: 🐛 Signed-off-by: Andy Augustin <dev@andreas-augustin.org> * fix: 🐛 Signed-off-by: Andy Augustin <dev@andreas-augustin.org> * fix: 🐛 Signed-off-by: Andy Augustin <dev@andreas-augustin.org> * fix: 🐛 Signed-off-by: Andy Augustin <dev@andreas-augustin.org> * fix: 🐛 Signed-off-by: Andy Augustin <dev@andreas-augustin.org> * fix: 🐛 Signed-off-by: Andy Augustin <dev@andreas-augustin.org> * feat: ✨ add output Signed-off-by: Andy Augustin <dev@andreas-augustin.org> --------- Signed-off-by: Andy Augustin <dev@andreas-augustin.org>
Thanks @AndreasAugustin for the 2.0.1 release. Just tried that and change But I had the following issue:
See the details at: https://github.com/kdeldycke/awesome-falsehood/actions/runs/8341154880/job/22826633975#step:3:151 That's kind of strange as I always used a specific token with workflow permissions (as documented here: https://github.com/kdeldycke/workflows?tab=readme-ov-file#permissions-and-token). Can you spot anything strange in the execution logs of the action? Remember that I'm using it as a reuseable workflow so some subtleties might have influenced the process. |
Hi @kdeldycke Seems you are currently not using your PAT and instead the GitHub secret. Hope the current idea helps. Am on mobile and it is hard to type and search for links/type examples. https://docs.github.com/en/actions/using-workflows/reusing-workflows#using-inputs-and-secrets-in-a-reusable-workflow Update had a closer look and my guess is that the statement above is right. Here some more details/thoughts: docs:
uses: kdeldycke/workflows/.github/workflows/docs.yaml@v3.4.1
# add this line
secrets: inherit |
@kdeldycke I wrote a small test to verify my theory. Please check the workflow file here https://github.com/AndreasAugustin/sync-test/blob/main/.github/workflows/outer_call.yml without the So I am kinda sure you are using the fallback instead of the Also within the |
@kdeldycke did you have the chance to test the suggestion with Further info: #478 (#516) is now (finally) released with (Sorry for hijacking this issue ticket) |
Yes, it looks that it is the case. The question is why?
Yep, that's the definitive proof the workflow is falling back on the local So... I updated to latest And it works: https://github.com/kdeldycke/awesome-falsehood/actions/runs/8844290657/job/24285909296#step:3:146 Thanks @AndreasAugustin for the help! Still, I don't understand why my custom 🤔 My guts tells me its because I'm too deep in the inception: I use reuseable workflow to update workflows from the repository implementing the reuseable workflows! 😵💫 |
@kdeldycke Thats somehow different between reusable workflows or writing an action. |
Yes, something like that. But it was my understanding that my strategy was already working as it is not the first time I refer to local secrets. Anyway, I'll continue testing my hypothesis. Thanks @AndreasAugustin for taking the time trying to solve this mystery! 🤗 |
Is there an existing issue for this?
Describe the bug
Variables in the form of
${...}
, like${SOURCE_REPO_PATH}
or${TEMPLATE_GIT_HASH}
are not replaced by their values in the PR's body.Expected Behavior
Based on the default value of the
pr_body
parameter of the action, which reference${SOURCE_REPO_PATH}
and${TEMPLATE_GIT_HASH}
, I expect these same variable to be replaced by their values.Current Behavior
In my reuseable workflow, I have a job using
actions-template-sync
with apr_body
parameter defined as such:The body of the resulting PR looks like this:
Its markdown is:
Here you can see that
${{ ... }}
variables are replaced by their values but the${...}
are not.Possible Solution
Maybe I am wrong and I cannot reuse the
${SOMETHING}
format. So I tried an alternative and replaced them by${{ env.SOMETHING }}
but they reference an empty value, as theenv
is not populated by these variables.Maybe we should let the action populate the local
env
with its own variables so${{ env.SOMETHING }}
will work? Not sure how natural this syntax looks like and how much reusing theenv
object is bullet-proof.Additional Information/Context
This is a follow up of #477
Note that the
${...}
/${{ ... }}
syntax difference has already been encounter and discussed a bit in another issue.Template sync version Version
2.0.0
The text was updated successfully, but these errors were encountered: