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

nox: add actionlint to lint Github Actions workflows #1848

Merged
merged 2 commits into from
Sep 17, 2024
Merged

Conversation

gotmax23
Copy link
Collaborator

@gotmax23 gotmax23 commented Sep 9, 2024

This PR integrates actionlint into our CI pipeline to check our Github Actions for best practices and common errors.

Copy link
Contributor

@oraNod oraNod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

brilliant work @gotmax23

noxfile.py Show resolved Hide resolved
noxfile.py Outdated Show resolved Hide resolved
Copy link
Contributor

@oraNod oraNod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this and for fixing those issues in the package docs build workflow @gotmax23

@oraNod
Copy link
Contributor

oraNod commented Sep 17, 2024

@gotmax23 I think this is ready to merge. Can you please add the relevant backport labels? I'm inclined to backport to stable-2.17 only but maybe we should keep this on devel until we cut stable-2.18. Thank you.

@gotmax23
Copy link
Collaborator Author

I see no reason not to backport this to all stable branches and fix any issues that may come up there too.

@gotmax23
Copy link
Collaborator Author

What do you think, @oraNod? Is there something in particular you're worried about?

@gotmax23
Copy link
Collaborator Author

In any case, I'll merge this to devel now

This PR integrates [actionlint](https://github.com/rhysd/actionlint)
into our CI pipeline to check our Github Actions for best practices and
common errors.
@gotmax23
Copy link
Collaborator Author

Rebasing on devel first

@gotmax23 gotmax23 added the merge_commit Use "Create a merge commit" when applying this PR label Sep 17, 2024
@oraNod
Copy link
Contributor

oraNod commented Sep 17, 2024

@gotmax23 I'm not worried about anything necessarily but just wasn't sure. now that I think about it again I guess there's no reason not to backport. thanks for adding this and handling the merge.

@gotmax23
Copy link
Collaborator Author

Sounds good, @oraNod. Thanks!

@gotmax23 gotmax23 merged commit 3b43d64 into devel Sep 17, 2024
18 checks passed
@gotmax23 gotmax23 deleted the actionlint branch September 17, 2024 21:46
@gotmax23 gotmax23 added backport-2.15 Automatically create a backport for the stable-2.15 branch backport-2.14 Automatically create a backport for the stable-2.14 branch backport-2.16 Automatically create a backport for the stable-2.16 branch backport-2.17 Automatically create a backport for the stable-2.17 branch labels Sep 17, 2024
Copy link

patchback bot commented Sep 17, 2024

Backport to stable-2.15: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply 3b43d64 on top of patchback/backports/stable-2.15/3b43d6467dc97524a6e5184b069f4a590e9b4392/pr-1848

Backporting merged PR #1848 into devel

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/ansible/ansible-documentation.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/stable-2.15/3b43d6467dc97524a6e5184b069f4a590e9b4392/pr-1848 upstream/stable-2.15
  4. Now, cherry-pick PR nox: add actionlint to lint Github Actions workflows #1848 contents into that branch:
    $ git cherry-pick -x 3b43d6467dc97524a6e5184b069f4a590e9b4392
    If it'll yell at you with something like fatal: Commit 3b43d6467dc97524a6e5184b069f4a590e9b4392 is a merge but no -m option was given., add -m 1 as follows instead:
    $ git cherry-pick -m1 -x 3b43d6467dc97524a6e5184b069f4a590e9b4392
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR nox: add actionlint to lint Github Actions workflows #1848 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/stable-2.15/3b43d6467dc97524a6e5184b069f4a590e9b4392/pr-1848
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

Copy link

patchback bot commented Sep 17, 2024

Backport to stable-2.17: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply 3b43d64 on top of patchback/backports/stable-2.17/3b43d6467dc97524a6e5184b069f4a590e9b4392/pr-1848

Backporting merged PR #1848 into devel

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/ansible/ansible-documentation.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/stable-2.17/3b43d6467dc97524a6e5184b069f4a590e9b4392/pr-1848 upstream/stable-2.17
  4. Now, cherry-pick PR nox: add actionlint to lint Github Actions workflows #1848 contents into that branch:
    $ git cherry-pick -x 3b43d6467dc97524a6e5184b069f4a590e9b4392
    If it'll yell at you with something like fatal: Commit 3b43d6467dc97524a6e5184b069f4a590e9b4392 is a merge but no -m option was given., add -m 1 as follows instead:
    $ git cherry-pick -m1 -x 3b43d6467dc97524a6e5184b069f4a590e9b4392
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR nox: add actionlint to lint Github Actions workflows #1848 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/stable-2.17/3b43d6467dc97524a6e5184b069f4a590e9b4392/pr-1848
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

Copy link

patchback bot commented Sep 17, 2024

Backport to stable-2.14: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply 3b43d64 on top of patchback/backports/stable-2.14/3b43d6467dc97524a6e5184b069f4a590e9b4392/pr-1848

Backporting merged PR #1848 into devel

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/ansible/ansible-documentation.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/stable-2.14/3b43d6467dc97524a6e5184b069f4a590e9b4392/pr-1848 upstream/stable-2.14
  4. Now, cherry-pick PR nox: add actionlint to lint Github Actions workflows #1848 contents into that branch:
    $ git cherry-pick -x 3b43d6467dc97524a6e5184b069f4a590e9b4392
    If it'll yell at you with something like fatal: Commit 3b43d6467dc97524a6e5184b069f4a590e9b4392 is a merge but no -m option was given., add -m 1 as follows instead:
    $ git cherry-pick -m1 -x 3b43d6467dc97524a6e5184b069f4a590e9b4392
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR nox: add actionlint to lint Github Actions workflows #1848 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/stable-2.14/3b43d6467dc97524a6e5184b069f4a590e9b4392/pr-1848
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

Copy link

patchback bot commented Sep 17, 2024

Backport to stable-2.16: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply 3b43d64 on top of patchback/backports/stable-2.16/3b43d6467dc97524a6e5184b069f4a590e9b4392/pr-1848

Backporting merged PR #1848 into devel

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/ansible/ansible-documentation.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/stable-2.16/3b43d6467dc97524a6e5184b069f4a590e9b4392/pr-1848 upstream/stable-2.16
  4. Now, cherry-pick PR nox: add actionlint to lint Github Actions workflows #1848 contents into that branch:
    $ git cherry-pick -x 3b43d6467dc97524a6e5184b069f4a590e9b4392
    If it'll yell at you with something like fatal: Commit 3b43d6467dc97524a6e5184b069f4a590e9b4392 is a merge but no -m option was given., add -m 1 as follows instead:
    $ git cherry-pick -m1 -x 3b43d6467dc97524a6e5184b069f4a590e9b4392
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR nox: add actionlint to lint Github Actions workflows #1848 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/stable-2.16/3b43d6467dc97524a6e5184b069f4a590e9b4392/pr-1848
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@gotmax23
Copy link
Collaborator Author

Ah, this probably needs to be done manually because of the python-version conflicts...

gotmax23 added a commit to gotmax23/ansible-documentation that referenced this pull request Sep 17, 2024
gotmax23 added a commit to gotmax23/ansible-documentation that referenced this pull request Sep 17, 2024
oraNod pushed a commit that referenced this pull request Sep 18, 2024
gotmax23 added a commit to gotmax23/ansible-documentation that referenced this pull request Sep 18, 2024
gotmax23 added a commit to gotmax23/ansible-documentation that referenced this pull request Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-2.14 Automatically create a backport for the stable-2.14 branch backport-2.15 Automatically create a backport for the stable-2.15 branch backport-2.16 Automatically create a backport for the stable-2.16 branch backport-2.17 Automatically create a backport for the stable-2.17 branch merge_commit Use "Create a merge commit" when applying this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants