diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..1b4cc85 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,55 @@ +# This is a basic workflow to help you get started with Actions + +name: GVLUPDATE + +# Controls when the workflow will run +on: + # Runs on pushes targeting the default branch + schedule: + - cron: "*/0 11 * * 4" + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + cron: + # The type of runner that the job will run on + + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Checkout source code + uses: actions/checkout@v2 + with: + token: ${{ secrets.PAT }} + - name: Use Node.js 13.3.1 + uses: actions/setup-node@v3.4.1 + with: + node-version: 13.3.0 + + - name: Run GVL node file + run: | + npm install + node update-vendor-list.js + git status + + - name: Updating code + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: Updated GVL data list to latest version + branch: master + status_options: '--untracked-files=no' + add_options: '-u' + skip_dirty_check: true + skip_fetch: true + skip_checkout: true + create_branch: true + + - name: "Run if changes have been detected" + if: steps.auto-commit-action.outputs.changes_detected == 'true' + run: echo "Files updated successfully!" + + - name: "Run if no changes have been detected" + if: steps.auto-commit-action.outputs.changes_detected == 'false' + run: echo "No changes detected!" diff --git a/package.json b/package.json index 0be2349..107ddf4 100644 --- a/package.json +++ b/package.json @@ -61,11 +61,13 @@ "@vue/cli-plugin-typescript": "^3.12.0", "@vue/eslint-config-typescript": "^5.0.1", "@vue/eslint-plugin": "^4.2.0", + "axios": "^0.27.2", "babel-eslint": "^10.0.1", "css-loader": "^3.2.1", "eslint": "^5", "eslint-plugin-vue": "^5.0.0", "fibers": "^4.0.1", + "fs": "^0.0.1-security", "html-webpack-plugin": "^3.2.0", "lint-staged": "^8.1.5", "mocha": "^6.2.2", @@ -76,6 +78,7 @@ "ts-node": "^8.5.4", "typescript": "^3.7.3", "url-loader": "^3.0.0", + "util": "^0.12.4", "vue-loader": "^15.7.2", "vue-template-compiler": "^2.6.10", "vue-ts-plugin": "^0.1.0", @@ -83,4 +86,4 @@ "webpack-cli": "^3.3.10", "webpack-dev-server": "^3.9.0" } -} +} \ No newline at end of file diff --git a/update-vendor-list.js.txt b/update-vendor-list.js similarity index 100% rename from update-vendor-list.js.txt rename to update-vendor-list.js