configure-aws-credentials icon indicating copy to clipboard operation
configure-aws-credentials copied to clipboard

Replace deprecated set-output function with GITHUB_OUTPUT

Open jhansen-well opened this issue 2 years ago • 4 comments

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 avatar Oct 12 '22 19:10 jhansen-well

I've upgraded my actions to use the v1-node16 as mentioned in this issue - https://github.com/aws-actions/configure-aws-credentials/issues/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/)

swananddhole avatar Oct 17 '22 10:10 swananddhole

Looks like it should be fixed by 1cb4968956a6a7aa09e9b7808b539e4df883f610. 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)

sindrig avatar Oct 17 '22 12:10 sindrig

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.

kellertk avatar Oct 19 '22 04:10 kellertk

@kellertk do we need to change anything in how we reference in the GitHub actions. aws-actions/[email protected]

drey0143143 avatar Oct 19 '22 14:10 drey0143143

@kellertk do we need to change anything in how we reference in the GitHub actions. aws-actions/[email protected]

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)

kellertk avatar Oct 19 '22 17:10 kellertk

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

niklas302 avatar Oct 20 '22 08:10 niklas302

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/[email protected] 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/[email protected]. 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 avatar Oct 21 '22 03:10 kellertk

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...

gabriel-robaina-tw avatar Oct 21 '22 17:10 gabriel-robaina-tw

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

szabikr avatar Oct 24 '22 12:10 szabikr

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/[email protected] 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/[email protected]. 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

devcauldron avatar Oct 24 '22 20:10 devcauldron

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)

kellertk avatar Oct 25 '22 16:10 kellertk

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'

Purely-Jonas avatar Nov 11 '22 15:11 Purely-Jonas

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?

jsf9k avatar Dec 02 '22 01:12 jsf9k

hey, when is v2 getting released?

peterdeme avatar Dec 26 '22 14:12 peterdeme

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 avatar Feb 17 '23 12:02 ADTC

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.

mluypaert avatar Feb 20 '23 09:02 mluypaert

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.

steeef avatar Feb 21 '23 16:02 steeef

Its also not a protected branch like master is image

bryantbiggs avatar Feb 21 '23 17:02 bryantbiggs

@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?

ADTC avatar Feb 21 '23 17:02 ADTC

@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.

steeef avatar Feb 21 '23 18:02 steeef

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.

lpsinger avatar Mar 06 '23 22:03 lpsinger

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.

peterwoodworth avatar Mar 07 '23 02:03 peterwoodworth

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.

github-actions[bot] avatar Mar 07 '23 02:03 github-actions[bot]

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

ADTC avatar Mar 07 '23 04:03 ADTC

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

peterwoodworth avatar Mar 07 '23 20:03 peterwoodworth