├── Dockerfile ├── README.md └── entrypoint.sh /Dockerfile: -------------------------------------------------------------------------------- 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 " 11 | 12 | RUN apk add --no-cache curl ca-certificates 13 | 14 | ADD *.sh / 15 | 16 | ENTRYPOINT ["/entrypoint.sh"] 17 | CMD ["--help"] 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 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 | on: push 16 | jobs: 17 | curl: 18 | runs-on: ubuntu-latest 19 | steps: 20 | - name: curl 21 | uses: wei/curl@master 22 | with: 23 | args: https://httpbin.org/get 24 | ``` 25 | 26 | ``` 27 | on: push 28 | jobs: 29 | curl: 30 | runs-on: ubuntu-latest 31 | steps: 32 | - name: curl 33 | uses: wei/curl@v1 34 | with: 35 | args: -X POST https://httpbin.org/post 36 | ``` 37 | 38 | ``` 39 | on: push 40 | jobs: 41 | curl: 42 | runs-on: ubuntu-latest 43 | steps: 44 | - uses: actions/checkout@master 45 | - name: curl 46 | uses: wei/curl@v1 47 | with: 48 | args: --upload-file .github/workflows/main.yml https://transfer.sh/main-workflow.yml 49 | ``` 50 | 51 | ### Docker 52 | ``` 53 | docker run --rm $(docker build -q .) \ 54 | https://httpbin.org/get 55 | ``` 56 | 57 | 58 | ## Author 59 | [Wei He](https://github.com/wei) _github@weispot.com_ 60 | 61 | 62 | ## License 63 | [MIT](https://wei.mit-license.org) 64 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | sh -c "curl --silent --show-error --fail $*" 6 | --------------------------------------------------------------------------------