Home > Mobile >  Can I use a github action to rename a file?
Can I use a github action to rename a file?

Time:12-30

I want to be able to update a GitHub page at a scheduled time. Only way I've thought of is to rename the updated file at the scheduled time to index and delete the previous index. Is there a way for actions to delete or rename files?

CodePudding user response:

You can use mv from Linux command:

mv oldfile.txt newfile.txt

Here's how it will look in the workflow (YML) file:

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Rename file 
        run: mv oldfile.txt newfile.txt

      - name: Delete file 
        run: rm -f file.txt
  • Related