Skip to content

Commit

Permalink
feat(deps): upgrade docker/login-action to v2 (#1000)
Browse files Browse the repository at this point in the history
To prevent this warning:

> Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: docker/login-action@v2. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
  • Loading branch information
dennybiasiolli authored Jun 4, 2024
1 parent aaae3cd commit 14942c1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ export class GitHubWorkflow extends PipelineBase {

return [
{
uses: 'docker/login-action@v2',
uses: 'docker/login-action@v3',
with: params,
},
];
Expand Down
2 changes: 1 addition & 1 deletion test/__snapshots__/github.cn.test.ts.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/__snapshots__/github.test.ts.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions test/docker.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ describe('correct format for docker credentials:', () => {
const file = fs.readFileSync(github.workflowPath, 'utf-8');
const workflow = YAML.parse(file);

const steps = findStepByJobAndUses(workflow, 'Assets-DockerAsset1', 'docker/login-action@v2');
const steps = findStepByJobAndUses(workflow, 'Assets-DockerAsset1', 'docker/login-action@v3');

expect(steps.length).toEqual(1);
expect(steps[0]).toEqual({
uses: 'docker/login-action@v2',
uses: 'docker/login-action@v3',
with: {
registry: '000000000000.dkr.ecr.us-east-1.amazonaws.com',
},
Expand All @@ -44,11 +44,11 @@ describe('correct format for docker credentials:', () => {
const file = fs.readFileSync(github.workflowPath, 'utf-8');
const workflow = YAML.parse(file);

const steps = findStepByJobAndUses(workflow, 'Assets-DockerAsset1', 'docker/login-action@v2');
const steps = findStepByJobAndUses(workflow, 'Assets-DockerAsset1', 'docker/login-action@v3');

expect(steps.length).toEqual(1);
expect(steps[0]).toEqual({
uses: 'docker/login-action@v2',
uses: 'docker/login-action@v3',
with: {
username: '${{ secrets.DOCKERHUB_USERNAME }}',
password: '${{ secrets.DOCKERHUB_TOKEN }}',
Expand All @@ -67,11 +67,11 @@ describe('correct format for docker credentials:', () => {
const file = fs.readFileSync(github.workflowPath, 'utf-8');
const workflow = YAML.parse(file);

const steps = findStepByJobAndUses(workflow, 'Assets-DockerAsset1', 'docker/login-action@v2');
const steps = findStepByJobAndUses(workflow, 'Assets-DockerAsset1', 'docker/login-action@v3');

expect(steps.length).toEqual(1);
expect(steps[0]).toEqual({
uses: 'docker/login-action@v2',
uses: 'docker/login-action@v3',
with: {
username: '${{ secrets.CUSTOM_USERNAME }}',
password: '${{ secrets.CUSTOM_PASSWORD }}',
Expand All @@ -89,18 +89,18 @@ describe('correct format for docker credentials:', () => {
const file = fs.readFileSync(github.workflowPath, 'utf-8');
const workflow = YAML.parse(file);

const steps = findStepByJobAndUses(workflow, 'Assets-DockerAsset1', 'docker/login-action@v2');
const steps = findStepByJobAndUses(workflow, 'Assets-DockerAsset1', 'docker/login-action@v3');

expect(steps.length).toEqual(2);
expect(steps[0]).toEqual({
uses: 'docker/login-action@v2',
uses: 'docker/login-action@v3',
with: {
username: '${{ secrets.DOCKERHUB_USERNAME }}',
password: '${{ secrets.DOCKERHUB_TOKEN }}',
},
});
expect(steps[1]).toEqual({
uses: 'docker/login-action@v2',
uses: 'docker/login-action@v3',
with: {
registry: '000000000000.dkr.ecr.us-east-1.amazonaws.com',
},
Expand Down Expand Up @@ -146,10 +146,10 @@ describe('correct format for docker credentials:', () => {
const github = createDockerGithubWorkflow(app, [DockerCredential.ghcr()]);
const file = fs.readFileSync(github.workflowPath, 'utf-8');
const workflow = YAML.parse(file);
const steps = findStepByJobAndUses(workflow, 'Assets-DockerAsset1', 'docker/login-action@v2');
const steps = findStepByJobAndUses(workflow, 'Assets-DockerAsset1', 'docker/login-action@v3');

expect(steps[0]).toEqual({
uses: 'docker/login-action@v2',
uses: 'docker/login-action@v3',
with: {
registry: 'ghcr.io',
username: '${{ github.actor }}',
Expand Down

0 comments on commit 14942c1

Please sign in to comment.