Skip to content

Added a workflow to keep the help output copyright year current - #6266

Open
nickanderson wants to merge 1 commit into
cfengine:masterfrom
nickanderson:copyright-year-automation
Open

Added a workflow to keep the help output copyright year current#6266
nickanderson wants to merge 1 commit into
cfengine:masterfrom
nickanderson:copyright-year-automation

Conversation

@nickanderson

@nickanderson nickanderson commented Aug 5, 2026

Copy link
Copy Markdown
Member

This adds a scheduled workflow that does the remembering: on January 2nd it
bumps the CF_COPYRIGHT and opens the pull request.

@larsewi larsewi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe you could use date directly in configure.ac similar to BUILD_YEAR?

AC_DEFINE(BUILD_YEAR, esyscmd([date +%Y | tr -d '\n']), "Software build year")
 ---snip---
AC_DEFINE(CF_COPYRIGHT, "2023 Northern.tech AS", "Copyright. To be used in help screens")

Comment thread .github/workflows/copyright_year.yml Outdated
Comment thread .github/workflows/copyright_year.yml Outdated
Comment thread .github/workflows/copyright_year.yml Outdated
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

git switch -c "$branch"
git commit -m "Updated help menu copyright year to $year" \

@larsewi larsewi Aug 5, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Other workflows produce signed / verified commits. Not sure how. But I don't think this approach will not do that.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

41898282 is the GitHub numeric user ID of the github-actions[bot] account.

gh api users/github-actions[bot]
{
  "login": "github-actions[bot]",
  "id": 41898282,
  "node_id": "MDM6Qm90NDE4OTgyODI=",
  "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4",
  "gravatar_id": "",
  "url": "https://api.github.com/users/github-actions%5Bbot%5D",
  "html_url": "https://github.com/apps/github-actions",
  "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
  "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
  "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
  "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
  "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
  "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
  "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
  "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
  "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
  "type": "Bot",
  "user_view_type": "public",
  "site_admin": false,
  "name": null,
  "company": null,
  "blog": "",
  "location": null,
  "email": null,
  "hireable": null,
  "bio": null,
  "twitter_username": null,
  "public_repos": 0,
  "public_gists": 0,
  "followers": 0,
  "following": 0,
  "created_at": "2018-07-30T09:30:16Z",
  "updated_at": "2026-05-26T13:34:34Z"
}

I can switch it to use cfengine/create-pull-requests@v7 I didnt see that and thoguth thismight be better than using someone elses create pull request job.

@nickanderson

Copy link
Copy Markdown
Member Author

Maybe you could use date directly in configure.ac similar to BUILD_YEAR?

AC_DEFINE(BUILD_YEAR, esyscmd([date +%Y | tr -d '\n']), "Software build year")
 ---snip---
AC_DEFINE(CF_COPYRIGHT, "2023 Northern.tech AS", "Copyright. To be used in help screens")

Yeah, I considered that but I figure that since Herman just updated the string it was desired to have the hard coded date.

Changelog: none
Signed-off-by: Nick Anderson <nick@cmdln.org>
@nickanderson
nickanderson force-pushed the copyright-year-automation branch from 4dc8c0f to 6d81b55 Compare August 5, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants