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

feat: workflow for roles readme #705

Merged
merged 31 commits into from
Oct 25, 2023
Merged

feat: workflow for roles readme #705

merged 31 commits into from
Oct 25, 2023

Conversation

Nemental
Copy link
Contributor

@Nemental Nemental commented Oct 23, 2023

Workflow for creation of roles README.md with aar-doc.

Fixes #694

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
Copy link
Member

@rndmh3ro rndmh3ro left a comment

Choose a reason for hiding this comment

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

Awesome that you did this! Thanks!

I left some comments to simplify the code.

.github/workflows/roles-readme.yml Outdated Show resolved Hide resolved
.github/workflows/roles-readme.yml Show resolved Hide resolved
.github/workflows/roles-readme.yml Outdated Show resolved Hide resolved
.github/workflows/roles-readme.yml Outdated Show resolved Hide resolved
Nemental and others added 6 commits October 24, 2023 09:27
Co-authored-by: Sebastian Gumprich <rndmh3ro@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
Co-authored-by: Sebastian Gumprich <rndmh3ro@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
Co-authored-by: Sebastian Gumprich <rndmh3ro@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
@Nemental
Copy link
Contributor Author

@rndmh3ro

Awesome that you did this! Thanks!

I left some comments to simplify the code.

Thank you also for your code suggestions - the changes have been implemented.
This was my first GitHub workflow that I worked on. Perfect issue to get me started! ;)

@Nemental
Copy link
Contributor Author

Maybe I should add a diff or other output step after README creation to show the differences/results?

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
@rndmh3ro
Copy link
Member

Maybe I should add a diff or other output step after README creation to show the differences/results?

I thought about that. In general it's a good idea, so let's keep the git diff action there.

But then I also thought: why not let the action update the README in the pull-request? This way the author of the PR doesn't have to check the diff and correct it, it get's corrected automatically.

Could you therefore try this push-action?

      - name: Push README
        uses: github-actions-x/commit@v2.9
        with:
          commit-message: 'update ${{ matrix.roles }} readme'
          rebase: true
          files: roles/${{ matrix.roles }}/README.md

With omitting the branch, it should push top the branch where the action gets executed. With omitting the author, it should use the author for the PR, I hope.

@rndmh3ro
Copy link
Member

You or I could also do this in another PR, if you want to get this merged, first!

@Nemental
Copy link
Contributor Author

great thoughts, thanks! I would like to test this myself. I gratefully accept any opportunity to practice GitHub workflow. 😄✌️

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
@Nemental
Copy link
Contributor Author

Damn, okay, now it has to work :D

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
@rndmh3ro
Copy link
Member

Maybe just run a git diff without any arguments?

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
@rndmh3ro
Copy link
Member

Seems that pushing to a fork is not easily possible. So instead, let's just push to the master branch when the action is running from master, like you initially did.

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
@Nemental
Copy link
Contributor Author

No, I don't want to give up yet. As I can see from the logs, the branch name is the problem. Give me one more try.
I also removed the diff-step, which would no longer be necessary if push worked.

@Nemental
Copy link
Contributor Author

Nemental commented Oct 25, 2023

Why does commit-action want to use 705/merge as branch name...

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
@Nemental
Copy link
Contributor Author

This PR will be my personal nemesis.

@rndmh3ro
Copy link
Member

Why does commit-action want to use 705/merge as branch name...

The action is running in the dev sec orga, not in your fork. So it checks it out as the number of the PR. The /merge is to show that your changes are merged into master before running the action.

@Nemental
Copy link
Contributor Author

Why does commit-action want to use 705/merge as branch name...

The action is running in the dev sec orga, not in your fork. So it checks it out as the number of the PR. The /merge is to show that your changes are merged into master before running the action.

If github.head_ref with default github.ref_name don't work, I don't know anymore.

Property name Type Description
github.head_ref string The head_ref or source branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is either pull_request or pull_request_target.
github.ref_name string The short ref name of the branch or tag that triggered the workflow run. This value matches the branch or tag name shown on GitHub. For example, feature-branch-1.

@rndmh3ro rndmh3ro merged commit 1b05766 into dev-sec:master Oct 25, 2023
36 checks passed
@rndmh3ro
Copy link
Member

Thanks! Let's see what happens!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create role documentation with Automated-Ansible-Role-Documentation
2 participants