You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Maintenance: Monthly reminder to update roadmap #4074
Main lesson learned is that when using cross-repo workflows that use local scripts, we must change the checkout in the target workflow to explicitly checkout itself.
There are two implicit designs that aren't easy to understand at first and docs don't call that out:
aws-powertools/actions is where the workflow is
monthly_roadmap_reminder.yml is the workflow name
The workflow runs in this repository
With that in mind, the target workflow naturally would try to do a code checkout as its first step. However, that code checkout will checkout this repository (Python source code), not the shared actions we want.
For this to work, the target workflow owned by aws-powertools/actions must explicitly pass which repository it will checkout code -- it can't be via ${{github.repo}} because it would resolve to powertools-lambda-python.
jobs:
build:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2with:
# NOTE Since it's called from another repository# we must checkout the repository where the github-script is (aws-powertools/actions)# otherwise the caller check out their own repository code (e.g., Python/TS), where the github-scripts aren't availablerepository: aws-powertools/actions
A nicer benefit of this is that we don't need to control from the target who can call it and try to abuse creating GitHub issues in another place, because it's the caller repository that runs the workflow (it's not a fire-n-forget).
Activity
github-actions commentedon Apr 5, 2024
This issue is now closed. Please be mindful that future comments are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
heitorlessa commentedon Apr 5, 2024
Reopening as there's some fixes to port from another branch, and to share lessons learned in this.
heitorlessa commentedon Apr 5, 2024
Main lesson learned is that when using cross-repo workflows that use local scripts, we must change the
checkoutin the target workflow to explicitlycheckoutitself.What do I mean by that?
Take the following job in mind
There are two implicit designs that aren't easy to understand at first and docs don't call that out:
aws-powertools/actionsis where the workflow ismonthly_roadmap_reminder.ymlis the workflow nameWith that in mind, the target workflow naturally would try to do a code checkout as its first step. However, that code checkout will checkout this repository (Python source code), not the shared actions we want.
For this to work, the target workflow owned by
aws-powertools/actionsmust explicitly pass which repository it will checkout code -- it can't be via${{github.repo}}because it would resolve topowertools-lambda-python.A nicer benefit of this is that we don't need to control from the target who can call it and try to abuse creating GitHub issues in another place, because it's the caller repository that runs the workflow (it's not a fire-n-forget).
github-actions commentedon Apr 18, 2024
This is now released under 2.37.0 version!
github-actions commentedon May 17, 2024
This is now released under 2.38.0 version!