{"id":18952296,"url":"https://github.com/step-security/git-restore-mtime-action","last_synced_at":"2025-10-20T00:33:17.032Z","repository":{"id":207245727,"uuid":"718766686","full_name":"step-security/git-restore-mtime-action","owner":"step-security","description":"A GitHub Workflow Action which restores timestamps of files in the current tree","archived":false,"fork":false,"pushed_at":"2025-05-30T08:01:32.000Z","size":61,"stargazers_count":0,"open_issues_count":8,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-02T01:16:45.902Z","etag":null,"topics":["step-security-maintained-actions"],"latest_commit_sha":null,"homepage":"https://docs.stepsecurity.io/actions/stepsecurity-maintained-actions","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/step-security.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-11-14T18:57:28.000Z","updated_at":"2025-05-30T05:36:39.000Z","dependencies_parsed_at":"2024-11-08T13:38:37.523Z","dependency_job_id":"ca97637d-d486-4f2d-b6b4-d2579ab661da","html_url":"https://github.com/step-security/git-restore-mtime-action","commit_stats":null,"previous_names":["step-security/git-restore-mtime-action"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/step-security/git-restore-mtime-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/step-security%2Fgit-restore-mtime-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/step-security%2Fgit-restore-mtime-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/step-security%2Fgit-restore-mtime-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/step-security%2Fgit-restore-mtime-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/step-security","download_url":"https://codeload.github.com/step-security/git-restore-mtime-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/step-security%2Fgit-restore-mtime-action/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263388769,"owners_count":23459264,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["step-security-maintained-actions"],"created_at":"2024-11-08T13:32:38.462Z","updated_at":"2025-10-20T00:33:16.961Z","avatar_url":"https://github.com/step-security.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-restore-mtime action\n\nA GitHub Workflow Action which restores timestamps of files in the current tree based on their last commit times. Uses the [git-restore-mtime](https://github.com/MestreLion/git-tools) script.\n\n## Usage\n\nThe sample workflow below illustrates a static site build and deploy using the\n[S3 Sync Action](https://github.com/jakejarvis/s3-sync-action). The `aws s3 sync` command relies on having the\ncorrect timestamps for the files to be uploaded, thus, we must reset them before\nrunning that action.\n\n__NOTE__: git-restore-mtime uses the ref log to find the correct timestamp\nfor each file. This requires a full git history.  See `checkout dist` task in\nthe example below.\n\n```yaml\nname: Build and Deploy\non:\n  push:\n    branches:\n      - main\n\njobs:\n  build-and-deploy:\n    runs-on: ubuntu-latest\n    steps:\n    - name: checkout\n      uses: actions/checkout@v4\n\n    # Note: This is *only* for the very next step, it is not required by\n    # git-restore-mtime-action.\n    - name: setup node\n      uses: actions/setup-node@v4\n      with:\n        node-version: 'latest'\n\n    # Run the build script which populates the ./dist folder\n    - name: build\n      run: |\n        yarn\n        yarn run build\n\n    # Merge ./dist into the 'gh-pages' branch (dist in this case)\n    - name: update dist branch\n      uses: peaceiris/actions-gh-pages@v2.3.1\n      env:\n        PERSONAL_TOKEN: ${{ secrets.ACCESS_TOKEN }}\n        PUBLISH_BRANCH: dist\n        PUBLISH_DIR: ./dist\n\n    # Check out the new branch\n    - name: checkout dist\n      uses: actions/checkout@v4\n      with:\n        ref: dist\n        # git-restore-mtime-bare uses the ref log to find the correct timestamp\n        # for each file. This requires a full git history. The default value (1)\n        # creates a shallow checkout.\n        fetch-depth: 0\n\n      # Fix timestamps\n      - name: restore timestamps\n        uses: step-security/git-restore-mtime-action@v2\n\n    # Upload to S3\n    - name: sync s3\n      uses: jakejarvis/s3-sync-action@2fb81a9e9fea11e078587911c27754e42e6a6e88\n      with:\n        args: --exclude '.git*/*' --delete --follow-symlinks\n      env:\n        SOURCE_DIR: './'\n        AWS_REGION: 'us-east-1'\n        AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}\n        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}\n        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n```\n\n### Configuration\n\n```yaml\n- name: restore timestamps\n  uses: step-security/git-restore-mtime-action@v2\n  with:\n    # Directory to change to before running the action. (Optional)\n    # Default: '.'\n    working-directory: '.'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstep-security%2Fgit-restore-mtime-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstep-security%2Fgit-restore-mtime-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstep-security%2Fgit-restore-mtime-action/lists"}