Skip to content

Commit

Permalink
Workflow changed to commit json file to a branch
Browse files Browse the repository at this point in the history
1. generate_sonic_image_links.sh is modified to checkout a dedicated branch(sonic_latest_images_links) and commit the sonic images links related json file to this branch.

2. json file from master branch is no more required and hence it is deleted.

3. html file updated to use the json file that is getting created in the branch
  • Loading branch information
kannankvs committed Oct 21, 2021
1 parent 11cf67a commit 27fcf97
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 409 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/sonic_image_links_create_workflow.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This is a basic workflow to help you get started with GitHub Actions

name: Run the shell script to generate sonic image links in sonic_image_links.json
name: Run the shell script to generate sonic image links in sonic_image_links.json in a dedicated branch

# Run the script once in a minute. Github may take 15 minutes to run this even though we request once in a minute, which is OK.
on:
Expand Down
11 changes: 7 additions & 4 deletions generate_sonic_image_links.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/usr/bin/env bash
git checkout -b sonic_latest_images_links
git config --global user.email "xinxliu@microsoft.com"
git config --global user.name "xinliu-seattle"
git reset --hard
git pull origin sonic_latest_images_links

#set -euo pipefail

Expand Down Expand Up @@ -145,8 +150,6 @@ do
done
echo "\n}" >> sonic_image_links.json

git config --global user.email "xinxliu@microsoft.com"
git config --global user.name "xinliu-seattle"
git add sonic_image_links.json
git commit -m "latest links for sonic images"
git push
git commit -m "latest links for sonic images in dedicated branch sonic_latest_images_links"
git push -f --set-upstream origin sonic_latest_images_links
Loading

0 comments on commit 27fcf97

Please sign in to comment.