From 6c26a43657de4ee7748847c27a6e3bd2de4221e6 Mon Sep 17 00:00:00 2001
From: Ciro Santilli <ciro.santilli@gmail.com>
Date: Fri, 16 Apr 2021 04:00:03 +0000
Subject: [PATCH] checkout

---
 .github/workflows/issue.yml | 10 ++++++----
 action.py                   | 18 ++++++++++++++++++
 2 files changed, 24 insertions(+), 4 deletions(-)
 create mode 100755 action.py

diff --git a/.github/workflows/issue.yml b/.github/workflows/issue.yml
index ae3b2de..71e1c6d 100644
--- a/.github/workflows/issue.yml
+++ b/.github/workflows/issue.yml
@@ -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 }}."
diff --git a/action.py b/action.py
new file mode 100755
index 0000000..6265339
--- /dev/null
+++ b/action.py
@@ -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)
-- 
GitLab