Can I change Html files on a specific date?

"Can I change Html files on a specific date?"

Hi
I’m using github pages for my project.
On holidays I change every Html file’s og-image.
For example, at Christmas, I change default.jpg to christmas.jpg.
But when the number of my (Html) files increases, it takes more time.
Since I change

<meta property="og:image" content="img/a.jpg">

to

<meta property="og:image" content="img/b.jpg">

in every file, I think it is possible to automate it with github actions.

Thank you.

Hi @franknoh, welcome to the GitHub Support Community! You should be able to set this up with the on.schedule syntax, and set this up as a cron to work on specific dates:

As an example, to run a workflow on Christmas day, you’d want to use the following schedule:

on:
  schedule:
    - cron: '0 0 25 12 *'

You’ll also need a different workflow to change it back once the event is over!

As for chancing the files themselves, it would depend on exactly how your project is set up, but there should be options available for editing your files from the command line and pushing them back to your repository.

Thanks!

Can you give me some hints about how to change the files?

Every Html file
(except for 404Error.html, 400Error.html, 503Error.html, these files don’t have og:image)
has<meta property="og:image" content="img/a.jpg">in its 14th line

That isn’t related to GitHub Actions. You need to write a shell script for that, or alternatively implement this in client-side JavaScript for the page.

Thanks
I found a solution with node js.