Skip to content

GitHub Action to check if there have been any changes in code in last day or any other duration.

License

Notifications You must be signed in to change notification settings

VikramTiwari/changed-in-duration

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

changed-in-duration

This GitHub action can be used to check if there have been any changes in code in last day or any other duration.

How it works

  • Prior to this, code has been cloned and checked out to a specific tag/branch using actions/checkout.
  • It checks the latest commit on HEAD and gets the time value from there as latest.
  • It then calculates the time against which we want to check. This is calculated using against = current_time - duration. See examples for how to pass this duration.
  • If against < latest, then status is set to true, otherwise false.
  • It sets this status as changed output value, usable in your workflow.

Examples

To use this action in your project, use the following:

- name: Changed in duration
  id: changed-in-duration
  uses: vikramtiwari/changed-in-duration@main

The Action sets an output variable called changed which can be used in a following step by using ${{ steps.changed-in-duration.outputs.changed}}.

By default it checks for new commits in last 24 hours. You can customize this to pass any other duration.

- name: Changed in duration
  id: changed-in-duration
  uses: vikramtiwari/changed-in-duration@main
  with:
    duration: 3600 # 1 hour

About

GitHub Action to check if there have been any changes in code in last day or any other duration.

Resources

License

Stars

Watchers

Forks

Packages

No packages published