action-add-labels icon indicating copy to clipboard operation
action-add-labels copied to clipboard

fix: Remove second `uses` in example

Open sarina opened this issue 3 years ago • 5 comments

What this PR does / Why we need it

Removes the first uses clause from the example Action code.

GitHub Actions only allows one uses clause, otherwise error 'uses' is already defined will appear.

image

You only need to call this action by invoking the action fro this repo, you do not additionally need to invoke actions/checkout@v2

Which issue(s) this PR fixes

It's possible that #333's complaint is resolved by this, but I don't know.

sarina avatar Feb 16 '22 19:02 sarina

@sarina Thank you for your contribution! As far as I know, you can use multiple uses clauses in steps. Can I see your workflow file?

aximov avatar Apr 20 '22 06:04 aximov

the commit that added the double uses line: https://github.com/openedx/tcril-engineering/commit/ce592eb449b87687700375991df476789ac701ac resulted on this workflow failure on the commit ce592eb:

image

This is the change I made that resolved the above Actions error: https://github.com/openedx/tcril-engineering/commit/1392dff234aec0ab3ef8d7d8346597639c085c6b note action run on commit 1392dff

image

This is the workflow that we currently have working: https://github.com/openedx/tcril-engineering/blob/main/.github/workflows/add-GHrequest-to-team-board.yml

sarina avatar Apr 20 '22 14:04 sarina

it may just be syntax? there's a few examples of multiple uses clauses here: https://docs.github.com/en/actions/learn-github-actions/contexts but none of them are in the

steps:
  - name:
    uses:
    uses:

syntax . Regardless without the uses: actions/checkout@v2 it still works. I've never had to use the checkout action to to grab another action.

sarina avatar Apr 20 '22 14:04 sarina

@aximov - I have been playing with additional Actions this morning and wherever I look, I see the checkout action being performed separately as part of the first in a series of job steps. See https://github.blog/2021-03-04-4-things-you-didnt-know-you-could-do-with-github-actions/ for an example of one job with multiple steps, each doing something specific - checkout, then npm, then dependency install, etc. I think it may be better to change this PR to not remove the checkout action entirely but rather put into its own step.

sarina avatar Apr 21 '22 12:04 sarina

Hi! This one has been open awhile. Any thoughts on my above response?

I also emphatically disagree that you can have two uses: clauses. Did you look at the error in my PR description? It literally says 'uses' is already defined

image

sarina avatar Sep 26 '22 13:09 sarina

Thanks! And thank you for creating and maintaining the action.

On Sun, Apr 30, 2023, 02:15 Nakayama Daichi @.***> wrote:

@.**** approved this pull request.

I apologize for the extremely late response. I'm glad that you and I have ultimately reached the same understanding regarding the workflow syntax. Thank you for creating this pull request. It will make the README more understandable.

— Reply to this email directly, view it on GitHub https://github.com/actions-ecosystem/action-add-labels/pull/350#pullrequestreview-1407058742, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPEWJPFENTR3AADJ5Z3KCTXDX7QBANCNFSM5OSUBATQ . You are receiving this because you were mentioned.Message ID: @.*** com>

sarina avatar May 01 '23 01:05 sarina