Skip to content

Commit 9bcbc03

Browse files
committed
workflows for updating profile
1 parent 1b04f9f commit 9bcbc03

17 files changed

+36
-8
lines changed

.github/workflows/update-readme.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Update Profile README
2+
3+
on:
4+
schedule:
5+
# Runs at 00:00 UTC every 3 days
6+
- cron: "0 0 */5 * *"
7+
workflow_dispatch:
8+
9+
jobs:
10+
update-readme:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v2
16+
17+
- name: Get a random image
18+
id: random-image
19+
run: |
20+
IMAGES=($(ls images))
21+
RANDOM_IMAGE=${IMAGES[$RANDOM % ${#IMAGES[@]}]}
22+
echo "::set-output name=image::$RANDOM_IMAGE"
23+
24+
- name: Update README
25+
run: |
26+
IMAGE_NAME=${{ steps.random-image.outputs.image }}
27+
sed -i 's|<img src="images/.*" >|<img src="images/'"$IMAGE_NAME"'" >|' README.md
28+
29+
- name: Commit changes
30+
run: |
31+
git config --global user.name 'github-actions[bot]'
32+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
33+
git add README.md
34+
git commit -m "Update profile image"
35+
git push

README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
<!-- <img src="https://github.com/nightcoder26/nightcoder26/assets/77844703/51b87967-3f71-453d-acba-9f8673c9038c" > -->
66

7-
<img src="https://github.com/nightcoder26/nightcoder26/assets/77844703/8bdc32d3-dd41-4d3a-b7d6-a2a3d49b76ac">
8-
7+
<img src="images/image4.jpg" >
98

109
</div>
1110

@@ -26,7 +25,6 @@ Here are some ideas to get you started:
2625
[![GitHub stats](https://github-readme-stats.vercel.app/api?username=nightcoder26)](https://github.com/nightcoder26/github-readme-stats)
2726
-->
2827

29-
3028
<div align="center">
3129

3230
<img src="https://github-readme-streak-stats.herokuapp.com/?user=nightcoder26&" alt="nightcoder26" style="display: inline-block; vertical-align: top;" />
@@ -55,7 +53,6 @@ Here are some ideas to get you started:
5553

5654
</div>
5755

58-
5956
</div>
6057
<h4 align="center">Contact</h4>
6158
<div>
@@ -80,10 +77,6 @@ Here are some ideas to get you started:
8077

8178
</div>
8279

83-
8480
<div align="center">
8581
<img src="https://komarev.com/ghpvc/?username=nightcoder26">
8682
</div>
87-
88-
89-

images/image1.jpg

73.4 KB
Loading

images/image10.jpg

859 KB
Loading

images/image11.jpg

914 KB
Loading

images/image12.jpg

759 KB
Loading

images/image13.jpg

1.84 MB
Loading

images/image14.jpg

2.69 MB
Loading

images/image15.gif

951 KB
Loading

images/image2.jpg

56.9 KB
Loading

0 commit comments

Comments
 (0)