Skip to content

Commit ef73363

Browse files
committed
feat: initial commit
0 parents  commit ef73363

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-0
lines changed

Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM alpine
2+
3+
LABEL "com.github.actions.name"="Github Action for curl"
4+
LABEL "com.github.actions.description"="Wraps the curl CLI to be used in Github Actions"
5+
LABEL "com.github.actions.icon"="download-cloud"
6+
LABEL "com.github.actions.color"="gray-dark"
7+
8+
LABEL "repository"="http://github.com/wei/curl"
9+
LABEL "homepage"="http://github.com/wei/curl"
10+
LABEL "maintainer"="Wei He <[email protected]>"
11+
12+
RUN apk add --no-cache curl ca-certificates
13+
14+
ADD *.sh /
15+
16+
ENTRYPOINT ["/entrypoint.sh"]
17+
CMD ["--help"]

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Github Action for curl
2+
3+
Wraps the curl CLI to be used in Github Actions. See also [Github Action for wget](https://github.com/marketplace/actions/github-action-for-wget).
4+
5+
6+
## Features
7+
* make http requests
8+
* http errors are treated as errors
9+
10+
11+
## Usage
12+
13+
### Github Actions
14+
```
15+
action "curl" {
16+
uses = "wei/curl@master"
17+
args = "https://httpbin.org/get"
18+
}
19+
```
20+
21+
```
22+
action "curl" {
23+
uses = "wei/curl@master"
24+
args = "-X POST https://httpbin.org/post"
25+
}
26+
```
27+
28+
```
29+
action "curl" {
30+
uses = "wei/curl@master"
31+
args = "--upload-file .github/main.workflow https://transfer.sh/main.workflow"
32+
}
33+
```
34+
35+
### Docker
36+
```
37+
docker run --rm $(docker build -q .) \
38+
https://httpbin.org/get
39+
```
40+
41+
42+
## Author
43+
[Wei He](https://github.com/wei) _[email protected]_
44+
45+
46+
## License
47+
[MIT](https://wei.mit-license.org)

entrypoint.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
sh -c "curl --silent --show-error --fail $*"

0 commit comments

Comments
 (0)