use checkout on raw api (#103)

* Update raw-api.yml

* fix typo

* feat: use checkout, not creating dir

* feat: update path

* feat: no need for cd
This commit is contained in:
William Harrison authored and GitHub committed 2023-05-07 19:41:36 +08:00
1 parent b454eaf81b
commit bcfb4ffb6a
2 files changed
+8 -10

No files matched your search

+7 -9
View File
@@ -16,27 +16,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: free-domains/raw-api
path: main
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 16
- name: Create raw-api Directory
run: |
mkdir raw-api
echo "raw.freesubdomains.org" > ./raw-api/CNAME
echo "" > ./raw-api/index.json
- name: Execute Script
run: node scripts/raw-api.js
- name: Commit
uses: cpina/github-action-push-to-another-repository@main
with:
source-directory: "raw-api"
source-directory: "main"
destination-github-username: free-domains
destination-repository-name: raw-api
user-email: bot@freesubdomains.org
+1 -1
View File
@@ -34,7 +34,7 @@ fs.readdir(directoryPath, function (err, files) {
combinedArray = combinedArray.concat(dataArray);
if (combinedArray.length === files.length) {
fs.writeFile("raw-api/index.json", JSON.stringify(combinedArray), (err) => {
fs.writeFile("main/index.json", JSON.stringify(combinedArray), (err) => {
if (err) throw err;
});
}