Skip to content
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

Update usage guide to mention github.actor instead of the legacy approaches #22

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kittydoor
Copy link

@kittydoor kittydoor commented Jul 10, 2024

Related to nektos/act#2115

@kittydoor kittydoor requested a review from a team as a code owner July 10, 2024 10:52
@kittydoor kittydoor changed the title Update usage guide to mention github.actor instead of the legacy appr… Update usage guide to mention github.actor instead of the legacy approaches Jul 10, 2024
@ChristopherHX
Copy link
Contributor

On the other hand, the string nektos/act in github.actor is causing bugs.

The slash has to be deleted from the actor context in my opinion, prior documenting such a way to skip steps. Due to me thinking documenting this, make the bar higher for that bug to get ever fixed

The slash is problematic, because programs parsing the actor expect no slash anywhere

@kittydoor
Copy link
Author

Tbh, I was thinking of that when I was writing this too. Normally, actor should be a username which means there's a clear character set allowed by GitHub. The slash violates that, and if people are inserting it into places and doing funky things like for example using it in the filename, things can go horribly wrong.

Can we change the value to something else quickly (and make a new major release due to backwards compatibility)? I'm not sure what would be best, since you don't want a collision with an actual username. Then we can also update and merge this PR, and get people using something more reliable going forward.

@kittydoor
Copy link
Author

Interesting discovery (while trying to figure out why the docs are lying to me about how to pass secrets to reusable workflows, I came across this): dependabot/dependabot-core#3253 (comment)

The github.actor for dependabot is dependabot[bot]

Snippet from the link above

jobs:
  do-stuff:
    runs-on: ubuntu-latest
    if: ${{ github.actor == 'dependabot[bot]' }}
    steps:
      - uses: actions/checkout

Perhaps for act we could do something like act[local], and avoid username conflicts but still enable for a unique identifier.

@ChristopherHX
Copy link
Contributor

ChristopherHX commented Jul 12, 2024

How do you think your proposal would work to detect act if you do

act --actor "dependabot[bot]"

?

In some scenarios it might be required that the actor is correctly set, but still steps should be skipped on act

This would be resolved by just not deleting old content that is more stable regarding this aspect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants