Skip to content

Commit

Permalink
This fixes #1 with dynamic NAME option
Browse files Browse the repository at this point in the history
  • Loading branch information
raiyansarker committed Sep 10, 2021
1 parent a0c4511 commit 1826639
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 27 deletions.
56 changes: 29 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
# Cloudflare DNS Export

This action uses Cloudflare API to get DNS details and saves it in a `txt` file. This action is fairly easy to setup. This only requires two information. One is `ZONE_ID` which you can find on the dashboard of your domain in Cloudflare.
This action uses Cloudflare API to get DNS details and saves it in a `txt` file.

## Example usage

```
name: Test
on:
schedule:
- cron: "*/5 * * * *"
jobs:
deploy:
runs-on: ubuntu-latest
name: Test
steps:
- uses: actions/checkout@v2
- name: Backup
uses: raiyansarker/cloudflare-dns-export@v1
with:
NAME: ${{ github.repository }}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
ZONE_ID: ${{secrets.ZONE_ID}}
API_KEY: ${{secrets.API_KEY}}
FOLDER: backup
```

This action is fairly easy to setup. This only requires two information. One is `ZONE_ID` which you can find on the dashboard of your domain in Cloudflare.

![](./images/zone-id.png)

Expand All @@ -12,7 +39,7 @@ And you need to get `API_KEY` that does have DNS management permissions. In orde

### `NAME`

**Required** Full name of your repository. It includes username and repository name (username/repository_name), e.g. `raiyansarker/cloudflare-dns-export`
**Required** Full name of your repository. You can dynamically set it by using `${{ github.repository }}` or you can manually write it in this format `username/repository_name`, e.g. `raiyansarker/cloudflare-dns-export`

### `GITHUB_TOKEN`

Expand Down Expand Up @@ -78,31 +105,6 @@ raiyansarker.com. 1 IN TXT "SECRETS for demo"
```

## Example usage

```
name: Test
on:
schedule:
- cron: "*/5 * * * *"
jobs:
deploy:
runs-on: ubuntu-latest
name: Test
steps:
- uses: actions/checkout@v2
- name: Backup
uses: raiyansarker/cloudflare-dns-export@v1
with:
NAME: "raiyansarker/test"
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
ZONE_ID: ${{secrets.ZONE_ID}}
API_KEY: ${{secrets.API_KEY}}
FOLDER: backup
```

## License

The scripts and documentation in this project are released under the [MIT License](https://github.com/raiyansarker/cloudflare-dns-export/blob/master/license.txt).
10 changes: 10 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,11 @@ he@1.2.0:
resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==

husky@^7.0.0:
version "7.0.2"
resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.2.tgz#21900da0f30199acca43a46c043c4ad84ae88dff"
integrity sha512-8yKEWNX4z2YsofXAMT7KvA1g8p+GxtB1ffV8XtpAEGuXNAbCV5wdNKH+qTpw8SM9fh4aMPDR+yQuKfgnreyZlg==

inflight@^1.0.4:
version "1.0.6"
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
Expand Down Expand Up @@ -579,6 +584,11 @@ picomatch@^2.0.4, picomatch@^2.2.1:
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972"
integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==

prettier@^2.4.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.0.tgz#85bdfe0f70c3e777cf13a4ffff39713ca6f64cba"
integrity sha512-DsEPLY1dE5HF3BxCRBmD4uYZ+5DCbvatnolqTqcxEgKVZnL2kUfyu7b8pPQ5+hTBkdhU9SLUmK0/pHb07RE4WQ==

randombytes@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a"
Expand Down

0 comments on commit 1826639

Please sign in to comment.