github / docs

The open-source repo for docs.github.com
https://docs.github.com
Creative Commons Attribution 4.0 International
15.84k stars 58.79k forks source link

More sophisticated example for `hashFiles` function #32305

Open hamirmahal opened 4 months ago

hamirmahal commented 4 months ago

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/actions/learn-github-actions/expressions#hashfiles

What part(s) of the article would you like to see updated?

I think it'd be beneficial if the hashFiles function showed slightly more sophisticated examples.

For example, what if I want to invalidate the cache any time .rs files at the top level of the src/ directory change?

I.e., I'd like to invalidate the cache if src/main.rs or src/constants.rs change, but not if anything in src/misc/ changes.

src/
├── constants.rs
├── main.rs
└── misc
    ├── main.rs

Additional information

No response

nguyenalex836 commented 3 months ago

@hamirmahal Thank you for raising this issue! I'll get this triaged for review :sparkles: Our team will provide feedback regarding the best next steps for this issue - thanks for your patience! 💛

hamirmahal commented 3 months ago

@nguyenalex836 You're welcome!

github-actions[bot] commented 3 months ago

Thanks for opening an issue! We've triaged this issue for technical review by a subject matter expert :eyes:

nguyenalex836 commented 3 months ago

@hamirmahal Thank you for your patience while our team reviewed! ✨

Our engineering believes adding these additional, more complex examples makes sense. Some experimentation may be necessary to figure out what patterns actually work and what scenarios GitHub supports 💛

Aside from the scenario you listed initially, do you have a list of more sophisticated scenarios you were looking to add?

hamirmahal commented 3 months ago

@nguyenalex836 You're welcome!

hamirmahal commented 3 months ago

I can't think of any more sophisticated scenarios at the moment, but I'll post them if I think of any.

nguyenalex836 commented 3 months ago

@hamirmahal Sounds like a plan ✨ For now, I'm adding our help wanted label to this issue. You, or anyone else, are welcome to submit a PR with the example regarding hashFiles function for review 💛

hamirmahal commented 1 month ago

@nguyenalex836 I don't think I know enough about the hashFiles function to contribute docs for it; it's why I opened this issue.

Is anyone from the team able to contribute them?

nguyenalex836 commented 1 month ago

@hamirmahal Apologies! Our overzealous bot closed this issue - I've just reopened so that a community member can pick this issue up 💛