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

Replace deprecated set-output function with GITHUB_OUTPUT #521

Closed
2 tasks
jhansen-well opened this issue Oct 12, 2022 · 25 comments
Closed
2 tasks

Replace deprecated set-output function with GITHUB_OUTPUT #521

jhansen-well opened this issue Oct 12, 2022 · 25 comments
Labels
effort/small This issue will take less than a day of effort to fix feature-request A feature should be added or improved. next-major-version This issue will be fixed/implemented in the next major version p1

Comments

@jhansen-well
Copy link

jhansen-well commented Oct 12, 2022

Describe the feature

The ::set-output:: function is deprecated in favor of using the GITHUB_OUTPUT environment file

Use Case

The set-output function is insecure according to this notification: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change
@jhansen-well jhansen-well added feature-request A feature should be added or improved. needs-triage This issue still needs to be triaged labels Oct 12, 2022
@kellertk kellertk added p1 effort/small This issue will take less than a day of effort to fix next-major-version This issue will be fixed/implemented in the next major version and removed needs-triage This issue still needs to be triaged labels Oct 13, 2022
@swananddhole
Copy link

I've upgraded my actions to use the v1-node16 as mentioned in this issue - #489. But I'm still getting the warning for set-output. I believe this requires more than just upgrading the node version to 16. (Ref: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/)

@sindrig
Copy link

sindrig commented Oct 17, 2022

Looks like it should be fixed by 1cb4968. Packaging seems to be broken though: https://github.com/aws-actions/configure-aws-credentials/actions/runs/3245630680/jobs/5323409444:

remote: error: GH006: Protected branch update failed for refs/heads/master.        
remote: error: 3 of 3 required status checks are expected. At least 1 approving review is required by reviewers with write access.        
To https://github.com/aws-actions/configure-aws-credentials
 ! [remote rejected] HEAD -> master (protected branch hook declined)

@kellertk
Copy link
Contributor

These changes are now integrated into all branches. There are still some cleanup tasks here for us: we need to work around branch protection rules and get a better packaging workflow in place, and we need to get our v1 release tag moved up to the current dist file.

@drey0143143
Copy link

@kellertk do we need to change anything in how we reference in the GitHub actions. aws-actions/configure-aws-credentials@v1.6.1

@kellertk
Copy link
Contributor

@kellertk do we need to change anything in how we reference in the GitHub actions. aws-actions/configure-aws-credentials@v1.6.1

If you want to stay up to date as we release changes, you'll want to use aws-actions/configure-aws-credentials@v1 or aws-actions/configure-aws-credentials@v1-node16. Those two refs will move as version updates happen. If you use a static version tag like 1.6.1, you'll stay on 1.6.1 (and probably get deprecation warnings)

@niklas302
Copy link

Hi, I am using aws-actions/configure-aws-credentials@v1-node16 and I am still getting warnings about set-output

@kellertk
Copy link
Contributor

kellertk commented Oct 21, 2022

Hi @niklas302 (and others) - are you sure this is coming from this action and not something else in your workflow? I took a quick look at the dist index.js for v1-node16 and v1, and we're using exactly the same function from the distributed @actions/core@1.10.0 core.js, which should no longer have the set-output problem.

Note: set-output had nothing to do with Node 16, this was a different problem that was fixed in @actions/core@1.10.0. The updated dependency is present on both the master and v1-node16 branches - we haven't run the internal workflow to update the v1 release tag yet, so if you are using @v1 in your action configuration, you'll still see this until we run that update. Because v1-node16 is a branch ref and not a tag that should already be up to date. Does this still happen if you reference a commit hash instead of a branch? You'd use "a485a1e9a44e8087c439d393c63ff3a8fd4a1d08" in place of v1-node16 in your configuration.

This action itself isn't using any direct echoing of set-output to stdout. We're only using GitHub's core.setOutput function from @actions/core.

@gabriel-robaina-tw
Copy link

You'd use "a485a1e9a44e8087c439d393c63ff3a8fd4a1d08" in place of v1-node16 in your configuration. Just tried that in my pipeline and the warnings are still there. Its probably coming from another action then...

@szabikr
Copy link

szabikr commented Oct 24, 2022

aws-actions/configure-aws-credentials@v1-node16 action fixes the issue for me, the warning is gone.

@devcauldron
Copy link

devcauldron commented Oct 24, 2022

Hi @niklas302 (and others) - are you sure this is coming from this action and not something else in your workflow? I took a quick look at the dist index.js for v1-node16 and v1, and we're using exactly the same function from the distributed @actions/core@1.10.0 core.js, which should no longer have the set-output problem.

Note: set-output had nothing to do with Node 16, this was a different problem that was fixed in @actions/core@1.10.0. The updated dependency is present on both the master and v1-node16 branches - we haven't run the internal workflow to update the v1 release tag yet, so if you are using @v1 in your action configuration, you'll still see this until we run that update. Because v1-node16 is a branch ref and not a tag that should already be up to date. Does this still happen if you reference a commit hash instead of a branch? You'd use "a485a1e9a44e8087c439d393c63ff3a8fd4a1d08" in place of v1-node16 in your configuration.

This action itself isn't using any direct echoing of set-output to stdout. We're only using GitHub's core.setOutput function from @actions/core.

@kellertk I'm still getting the warning using the v1-node16 and found an instance of using 'set-output' directly in dist/cleanup/index.js:1811 here when using Repository Search on Github.

still there in the following versions:

It is not present in the v1 version of that file

@kellertk
Copy link
Contributor

You can compare what we're publishing with what's in GitHub's source here in core/src/core.ts:192 . Specifically, there's a new check for the GITHUB_OUTPUT environment variable that wasn't present in previous versions of this file. Our published functions also contain this check. Previous versions of the GitHub source core/src/core.ts:192 don't have this extra check

(Note: we haven't moved the v1 tag as I explained above. The v1 version of this action has GitHub's old code without the GITHUB_OUTPUT check in it)

@Purely-Jonas
Copy link

Purely-Jonas commented Nov 11, 2022

Using aws-actions/configure-aws-credentials@v1-node16 instead removed the warning for me. I tested the action in isolation, here is the result of the run in case anyone is interested:

Using aws-actions/configure-aws-credentials@v1:
problem

Using aws-actions/configure-aws-credentials@v1-node16:
solution

Here is the workflow.yaml file that I tested it with:

name: 'pull-request'

concurrency:
  group: ${{ github.ref }}
  cancel-in-progress: true

on:
  pull_request:
    branches: [ main ]
    types: [ opened, reopened, synchronize ]

jobs:
  run-tests:
    runs-on: [ "custom-runner" ]
    steps:
      - name: aws login
        uses: aws-actions/configure-aws-credentials@v1-node16
        with:
          aws-region: us-east-2
          mask-aws-account-id: 'false'

@jsf9k
Copy link

jsf9k commented Dec 2, 2022

we haven't run the internal workflow to update the v1 release tag yet, so if you are using @v1 in your action configuration, you'll still see this until we run that update.

Is there any chance that the v1 tag will be updated soon?

@peterdeme
Copy link

hey, when is v2 getting released?

@ADTC
Copy link

ADTC commented Feb 17, 2023

Hello, we're still seeing this warning. What could be the reason?

  - name: Configure AWS Credentials
    uses: aws-actions/configure-aws-credentials@v1
    with:
      aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
      aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      aws-region: us-east-1

@mluypaert
Copy link

Hello, we're still seeing this warning. What could be the reason?

  - name: Configure AWS Credentials
    uses: aws-actions/configure-aws-credentials@v1
    with:
      aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
      aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      aws-region: us-east-1

@ADTC aws-actions/configure-aws-credentials@v1-node16 no longer throws this error, you could update your workflow to use that version instead.

tarsius added a commit to emacscollective/workflows that referenced this issue Feb 20, 2023
@steeef
Copy link

steeef commented Feb 21, 2023

Hello, we're still seeing this warning. What could be the reason?

  - name: Configure AWS Credentials
    uses: aws-actions/configure-aws-credentials@v1
    with:
      aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
      aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      aws-region: us-east-1

@ADTC aws-actions/configure-aws-credentials@v1-node16 no longer throws this error, you could update your workflow to use that version instead.

Any ideas on when this branch would get a release? Not really excited on switching to a separate branch that's behind the main branch.

@bryantbiggs
Copy link

bryantbiggs commented Feb 21, 2023

Its also not a protected branch like master is
image

@ADTC
Copy link

ADTC commented Feb 21, 2023

@steeef @bryantbiggs if I'm correct, v1 is a tag, and doesn't refer to the master branch. If that's so, then v1 is a lot older than v1-node16.

@aws-actions @mluypaert the Readme says both v1 and v1-node16 branches will receive the same updates. But as far as I can tell, only v1-node16 is a branch and has been getting updates even up to yesterday, whereas v1 is a tag which hasn't moved since Aug 3, 2022 (rightfully so, since tags aren't meant to move like branches). So is the Readme misleading?

@steeef
Copy link

steeef commented Feb 21, 2023

@ADTC I guess it depends on how long the maintainers intend on keeping v1-node16 around. I pin my third-party actions to specific releases, so I'd prefer to have a v2 release. It signals the direction of the project, and not that I should be relying on some testing branch.

@lpsinger
Copy link

lpsinger commented Mar 6, 2023

I think that this truly should be treated as the a bug. The README says (emphasis is my own):

GitHub actions has recently started throwing warning messages regarding the deprecation of Node 12. If you would like to stop seeing this warning, configure your action to use aws-actions/configure-aws-credentials@v1-node16. Both the v1 branch and the v1-node16 branch will receive the same updates moving forward.

Clearly that is not the case.

@peterwoodworth
Copy link
Contributor

Hey folks, sorry for all the confusion and lack of updates

v1-node16 has been released as a full v2 version - please feel safe to move to v2 as a stable release.

We don't plan on releasing further changes to v1, so if this issue persists on that version I would recommend upgrading.

@github-actions
Copy link

github-actions bot commented Mar 7, 2023

Comments on closed issues 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.

@ADTC
Copy link

ADTC commented Mar 7, 2023

@peterwoodworth will there be any breaking changes moving from the old v1 (not v1-node16) to the new v2?

tarsius added a commit to emacscollective/workflows that referenced this issue Mar 7, 2023
@peterwoodworth
Copy link
Contributor

There shouldn't be @ADTC, if there are, please report them in an issue 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/small This issue will take less than a day of effort to fix feature-request A feature should be added or improved. next-major-version This issue will be fixed/implemented in the next major version p1
Projects
None yet
Development

No branches or pull requests