create-preview-workflow 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +7 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -26,12 +26,16 @@ jobs:
26
26
  REPO="\${{ github.event.repository.name }}"
27
27
  DIR="\${USER}@\${REPO}"
28
28
  COMMIT_MSG="\$(git log -1 --pretty=format:'%s')"
29
+ COMMIT_SHA="\$(git log -1 --pretty=format:'%H')"
29
30
  PUSH_TIME="\$(date -u '+%Y-%m-%d %H:%M:%S UTC')"
31
+ GITHUB_URL="https://github.com/\${USER}/\${REPO}/commit/\${COMMIT_SHA}"
30
32
  echo "USER=\$USER" >> \$GITHUB_ENV
31
33
  echo "REPO=\$REPO" >> \$GITHUB_ENV
32
34
  echo "DIR=\$DIR" >> \$GITHUB_ENV
33
35
  echo "COMMIT_MSG=\$COMMIT_MSG" >> \$GITHUB_ENV
36
+ echo "COMMIT_SHA=\$COMMIT_SHA" >> \$GITHUB_ENV
34
37
  echo "PUSH_TIME=\$PUSH_TIME" >> \$GITHUB_ENV
38
+ echo "GITHUB_URL=\$GITHUB_URL" >> \$GITHUB_ENV
35
39
  - name: Clone target repo
36
40
  run: |
37
41
  git clone https://\${{ secrets.GH_SYNC_TOKEN }}@github.com/ssm123ssm/preview.git
@@ -43,7 +47,9 @@ jobs:
43
47
  cd preview/public/protected/\$DIR
44
48
  echo "Last sync: \$PUSH_TIME" > .sync_log
45
49
  echo "Last commit: \$COMMIT_MSG" >> .sync_log
50
+ echo "Commit SHA: \$COMMIT_SHA" >> .sync_log
46
51
  echo "Source: \$USER/\$REPO" >> .sync_log
52
+ echo "View diff: \$GITHUB_URL" >> .sync_log
47
53
  - name: Commit and push changes
48
54
  run: |
49
55
  cd preview
@@ -61,6 +67,6 @@ jobs:
61
67
  fs.mkdirSync(destDir, { recursive: true });
62
68
  fs.writeFileSync(path.join(destDir, "sync.yml"), workflow);
63
69
  console.log(
64
- "GitHub Actions workflow for Preview created at .github/workflows/sync.yml. Make sure to add the GH_SYNC_TOKEN secret in your repository settings."
70
+ "GitHub Actions workflow for Preview created at .github/workflows/sync.yml. Make sure to add the GH_SYNC_TOKEN secret in your repository settings."
65
71
  );
66
72
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-preview-workflow",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "bin": {
5
5
  "create-preview-workflow": "index.js"
6
6
  },