This commit is contained in:
Ciro Santilli
2021-04-16 04:00:03 +00:00
parent 5ef41d531a
commit 6c26a43657
2 changed files with 24 additions and 4 deletions

View File

@@ -6,11 +6,13 @@ jobs:
Issue:
runs-on: ubuntu-20.04
steps:
- run: echo "github ${{ github }}"
- run: echo "github.event_name ${{ github.event_name }}"
- run: echo "github.ref ${{ github.ref }}"
- run: echo "github.repository ${{ github.repository }}"
- run: echo "runner.os ${{ runner.os }}"
- run: echo "${{ github.workspace }}"
- run: ls ${{ github.workspace }}
- run: echo "${{ job.status }}."
- run: echo "github.workspace ${{ github.workspace }}"
- name: Check out repository code
uses: actions/checkout@v2
- run: ls "${{ github.workspace }}"
- run: "${{ github.workspace }}/action.py"
- run: echo "job.status ${{ job.status }}."

18
action.py Executable file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env python3
import random
import re
image_re = re.compile('^image::{china-dictatorship-media-base}/([^/[]+)')
images = []
with open('README.adoc', 'r') as f:
for line in f:
line = line.rstrip()
match = image_re.match(line)
if match:
images.append(match.group(1))
images = random.sample(images, 10)
for image in images:
print('https://raw.githubusercontent.com/cirosantilli/china-dictatorship-media/master/' + image)