Skip to content

Commit

Permalink
Initial implementation (#1)
Browse files Browse the repository at this point in the history
Co-authored-by: screenshot-action 📼 <[email protected]>
  • Loading branch information
osterman and actions-user authored Jan 10, 2024
1 parent fc4d0cd commit 5687d69
Show file tree
Hide file tree
Showing 16 changed files with 623 additions and 399 deletions.
75 changes: 0 additions & 75 deletions .github/workflows/auto-readme.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .github/workflows/feature-branch.yml

This file was deleted.

12 changes: 12 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Major Release Tagger

on:
release:
types:
- published

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: cloudposse/github-action-major-release-tagger@v1
48 changes: 0 additions & 48 deletions .github/workflows/test-negative.yml

This file was deleted.

48 changes: 0 additions & 48 deletions .github/workflows/test-positive.yml

This file was deleted.

60 changes: 60 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Test

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
screenshot:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write

steps:
- uses: actions/checkout@v3

- name: Run this composite action
id: screenshot
uses: ./ # Use the path to your action directory
with:
# Your action's inputs
url: "file://${{github.workspace}}/test/html/index.html"
output: "docs/example.png"
css: |
body {
background: rgb(2,0,36);
background: linear-gradient(139deg, rgba(2,0,36,1) 0%, rgba(9,9,121,1) 56%, rgba(147,0,255,1) 100%);
}
customizations: |
"#name": "${{ github.event.repository.name }}"
viewportWidth: 2000
viewportHeight: 800

- uses: stefanzweifel/git-auto-commit-action@v4
name: Commit artifact
id: auto-commit
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
commit_message: "chore: update example image"
commit_user_name: screenshot-action 📼
commit_user_email: [email protected]
commit_author: screenshot-action 📼 <[email protected]>
file_pattern: 'docs/*.png'

- name: Add Image to Step Summary
if: steps.auto-commit.outputs.changes_detected == 'true'
run: |
echo "## Generated Screenshot" >> $GITHUB_STEP_SUMMARY
echo "![Generated Screenshot](https://github.com/${{ github.repository }}/blob/${{ steps.auto-commit.outputs.commit_hash }}/${{ steps.screenshot.outputs.file }}?raw=true)" >> $GITHUB_STEP_SUMMARY
- name: No changes
if: steps.auto-commit.outputs.changes_detected == 'false'
run: |
echo "No changes to screenshot" >> $GITHUB_STEP_SUMMARY
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
.build-harness
build-harness
build-harness

node_modules

.DS_Store
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ SHELL := /bin/bash
# List of targets the `readme` target should call before generating the readme
export README_DEPS ?= docs/github-action.md

export GITHUB_WORKSPACE ?= $(PWD)

-include $(shell curl -sSL -o .build-harness "https://cloudposse.tools/build-harness"; echo .build-harness)

## Lint terraform code
lint:
$(SELF) terraform/install terraform/get-modules terraform/get-plugins terraform/lint terraform/validate
deps:
npm install

run:
node main.js
Loading

0 comments on commit 5687d69

Please sign in to comment.