Skip to content

Commit ced8e09

Browse files
committed
chore: update github action
1 parent c7da8ca commit ced8e09

File tree

4 files changed

+85
-1
lines changed

4 files changed

+85
-1
lines changed

.github/dependabot.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# see https://github.com/yi-Xu-0100/traffic-to-badge/blob/main/.github/dependabot.yml
2+
version: 2
3+
updates:
4+
# Enable version updates for npm
5+
- package-ecosystem: 'npm'
6+
directory: '/'
7+
schedule:
8+
interval: 'daily'
9+
# Maintain dependencies for GitHub Actions
10+
- package-ecosystem: 'github-actions'
11+
directory: '/'
12+
schedule:
13+
interval: 'daily'

.github/workflows/greetings.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Greetings
2+
3+
on: [pull_request, issues]
4+
5+
jobs:
6+
greeting:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/first-interaction@v1
10+
with:
11+
repo-token: ${{ secrets.GITHUB_TOKEN }}
12+
issue-message: 'Welcome your first issue here, thanks'
13+
pr-message: 'Welcome your first pr here, thanks'

.github/workflows/traffic2badge.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: traffic2badge
2+
on:
3+
push:
4+
branches:
5+
- master
6+
schedule:
7+
- cron: '1 0 * * *' #UTC
8+
9+
jobs:
10+
run:
11+
name: Make GitHub Traffic to Badge
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout Code
15+
uses: actions/[email protected]
16+
17+
- name: Get Commit Message
18+
id: message
19+
uses: actions/[email protected]
20+
env:
21+
FULL_COMMIT_MESSAGE: '${{ github.event.head_commit.message }}'
22+
with:
23+
result-encoding: string
24+
script: |
25+
var message = `${process.env.FULL_COMMIT_MESSAGE}`;
26+
core.info(message);
27+
if (message != '') return message;
28+
var time = new Date(Date.now()).toISOString();
29+
core.info(time);
30+
return `Get traffic data at ${time}`;
31+
32+
- name: Set Traffic
33+
id: traffic
34+
uses: yi-Xu-0100/[email protected]
35+
with:
36+
my_token: ${{ secrets.TRAFFIC_TOKEN }}
37+
#(default) static_list: ${{ github.repository }}
38+
#(default) traffic_branch: traffic
39+
#(default) views_color: brightgreen
40+
#(default) clones_color: brightgreen
41+
#(default) logo: github
42+
43+
- name: Deploy
44+
uses: peaceiris/[email protected]
45+
with:
46+
github_token: ${{ secrets.GITHUB_TOKEN }}
47+
publish_branch: ${{ steps.traffic.outputs.traffic_branch }}
48+
publish_dir: ${{ steps.traffic.outputs.traffic_path }}
49+
user_name: 'github-actions[bot]'
50+
user_email: 'github-actions[bot]@users.noreply.github.com'
51+
full_commit_message: ${{ steps.message.outputs.result }}
52+
53+
- name: Show Traffic Data
54+
run: |
55+
echo ${{ steps.traffic.outputs.traffic_branch }}
56+
echo ${{ steps.traffic.outputs.traffic_path }}
57+
cd ${{ steps.traffic.outputs.traffic_path }}
58+
ls -a

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![Build Status](https://travis-ci.org/MuYunyun/reactSPA.svg?branch=master) ![LICENSE MIT](https://img.shields.io/npm/l/express.svg)
1+
![GitHub views](https://raw.githubusercontent.com/MuYunyun/reactSPA/traffic/traffic-reactSPA/views.svg) ![Build Status](https://travis-ci.org/MuYunyun/reactSPA.svg?branch=master) ![LICENSE MIT](https://img.shields.io/npm/l/express.svg)
22

33
该项目是对 React 技术栈以及前端工程化的相关实践。
44

0 commit comments

Comments
 (0)