-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from comus3/developpement
added banner + testing workflow
- Loading branch information
Showing
4 changed files
with
207 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Update startTime on Merge to Main | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # Trigger this workflow only when there's a push to the 'main' branch | ||
|
||
jobs: | ||
update_start_time: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout the code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Update startTime in script.js | ||
run: | | ||
# Get current date in the desired format (ISO 8601 format) | ||
current_time=$(date --utc +'%Y-%m-%dT%H:%M:%SZ') | ||
# Use sed to replace the startTime in the script.js file with the current time | ||
sed -i "s/const startTime = new Date(\"[^\"]*\");/const startTime = new Date(\"$current_time\");/" script.js | ||
- name: Commit and push changes | ||
run: | | ||
git config user.name "GitHub Actions" | ||
git config user.email "[email protected]" | ||
git add script.js | ||
git commit -m "Update startTime to $current_time" | ||
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters