Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too many new actions #2

Merged
merged 40 commits into from
Jan 23, 2019
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
8f67939
WIP - cljfmt actions
bltavares Jan 15, 2019
0b06b7d
Update cljfmt/Dockerfile
bltavares Jan 21, 2019
91bb263
Update cljfmt/README.md
bltavares Jan 21, 2019
8f9c101
Update cljfmt/entrypoint.sh
bltavares Jan 21, 2019
0b6283e
Update cljfmt/Dockerfile
bltavares Jan 22, 2019
185e318
Update entrypoint.sh
bltavares Jan 22, 2019
3dd2d22
Update entrypoint.sh
bltavares Jan 22, 2019
32c2d85
Update entrypoint.sh
bltavares Jan 22, 2019
0474363
Checkout properly
bltavares Jan 22, 2019
386fcd2
Pull Request Review
bltavares Jan 22, 2019
5132ba0
wip
bltavares Jan 22, 2019
c5a3120
Fix checks for dirty commit
bltavares Jan 22, 2019
cbad246
Bogus username
bltavares Jan 22, 2019
0ea2c7e
Uses Github API to create commits
bltavares Jan 22, 2019
f99a791
Fix path
bltavares Jan 22, 2019
4bddd21
Post content of tree
bltavares Jan 22, 2019
3d8c3b1
Encode into base64
bltavares Jan 22, 2019
9399e57
Skip with exit code
bltavares Jan 22, 2019
e468cd2
Remove linebreak
bltavares Jan 22, 2019
e703904
Upload blobs encoded
bltavares Jan 22, 2019
db6881f
Fix spacing
bltavares Jan 22, 2019
1806a9d
Point to blobs
bltavares Jan 22, 2019
c77fbd4
fix quoting
bltavares Jan 22, 2019
c15ee35
Adds shellcheck action
bltavares Jan 23, 2019
9bf0216
Introduces hadolint
bltavares Jan 23, 2019
4a3d4ea
Fix path to lib.sh
bltavares Jan 23, 2019
87051da
Debug
bltavares Jan 23, 2019
9d51062
Fix check for github token
bltavares Jan 23, 2019
606b235
Adjust commit message
bltavares Jan 23, 2019
acdd27c
Allow using the action name or fallback to cljfmt
bltavares Jan 23, 2019
c8a8aeb
Documentation
bltavares Jan 23, 2019
c54c5b8
Adds shfmt
bltavares Jan 23, 2019
109755d
More flags
bltavares Jan 23, 2019
cd69dbb
Improve workflow
bltavares Jan 23, 2019
98f3f52
typo
bltavares Jan 23, 2019
c8e2836
Another type
bltavares Jan 23, 2019
77f60e6
Apply shfmt
bltavares Jan 23, 2019
b50b919
Adds powershell formatter
bltavares Jan 23, 2019
b287d65
Documentation
bltavares Jan 23, 2019
1b11fa3
Markdown linting
bltavares Jan 23, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# actions


```bash
action=$(jq --raw-output .action "$GITHUB_EVENT_PATH")
pr_url=$(jq --raw-output .pull_request.url "$GITHUB_EVENT_PATH")
```
# clojure-playground
Binary file added cljfmt/.DS_Store
Binary file not shown.
20 changes: 20 additions & 0 deletions cljfmt/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM clojure:lein-alpine

RUN apk --no-cache add \
curl \
jq \
ca-certificates \
bash \
git

COPY entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]

LABEL "com.github.actions.name"="cljfmt"
LABEL "com.github.actions.description"="Provides linting and fixes using cljfmt"
LABEL "com.github.actions.icon"="bot"
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check which actions are available

bltavares marked this conversation as resolved.
Show resolved Hide resolved
LABEL "com.github.actions.color"="green"

LABEL "repository"="http://github.com/bltavares/actions"
LABEL "homepage"="http://github.com/bltavares/actions"
LABEL "maintainer"="Bruno Tavares <[email protected]>"
12 changes: 12 additions & 0 deletions cljfmt/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

```hcl
workflow "on push" {
on = "push"
resolves = ["cljfmt lint"]
}

action "cljfmt lint" {
uses = "bltavares/actions/cljfmt@master"
secrets = ["GITHUB_TOKEN"]
}
```
28 changes: 28 additions & 0 deletions cljfmt/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

set -eo pipefail

fix() {
lein cljfmt fix

[[ -z $(git status -s) ]] && {
git config credential.helper 'cache --timeout=120'
git config user.email "[email protected]"
git config user.name "cljfmt fix"
git add .
git commit -m "Apply cljfmt fix"
git push -q https://${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git ${GITHUB_REF}
}
}

main() {
[[ -z "$GITHUB_TOKEN" ]] && echo "Set the GITHUB_TOKEN env variable." && exit 1

if [[ "${GITHUB_EVENT_NAME}" == "push" ]]; then
lein cljfmt check
elif [[ "$GITHUB_EVENT_NAME" == "issue_comment" ]]; then
fix
fi
}

main